window.divinaPlayer=function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=20)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(e,i,r){void 0===i&&(i=!1),n(this,t),this._fn=e,this._once=i,this._thisArg=r,this._next=this._prev=this._owner=null}return r(t,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),t}();function s(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var a=function(){function t(){n(this,t),this._head=this._tail=void 0}return r(t,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i}},{key:"has",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,arguments),t=t._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return s(this,new o(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return s(this,new o(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this?this:(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null,this)}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),t}();a.MiniSignalBinding=o,e.default=a,t.exports=e.default},function(t,e,i){var r,n,o;!function(i){var s=/iPhone/i,a=/iPod/i,h=/iPad/i,u=/\bAndroid(?:.+)Mobile\b/i,l=/Android/i,c=/\bAndroid(?:.+)SD4930UR\b/i,d=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,p=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,g=/BlackBerry/i,v=/BB10/i,y=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,m=/Mobile(?:.+)Firefox\b/i;function x(t,e){return t.test(e)}function b(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),i=e.split("[FBAN");void 0!==i[1]&&(e=i[0]),void 0!==(i=e.split("Twitter"))[1]&&(e=i[0]);var r={apple:{phone:x(s,e)&&!x(p,e),ipod:x(a,e),tablet:!x(s,e)&&x(h,e)&&!x(p,e),device:(x(s,e)||x(a,e)||x(h,e))&&!x(p,e)},amazon:{phone:x(c,e),tablet:!x(c,e)&&x(d,e),device:x(c,e)||x(d,e)},android:{phone:!x(p,e)&&x(c,e)||!x(p,e)&&x(u,e),tablet:!x(p,e)&&!x(c,e)&&!x(u,e)&&(x(d,e)||x(l,e)),device:!x(p,e)&&(x(c,e)||x(d,e)||x(u,e)||x(l,e))||x(/\bokhttp\b/i,e)},windows:{phone:x(p,e),tablet:x(f,e),device:x(p,e)||x(f,e)},other:{blackberry:x(g,e),blackberry10:x(v,e),opera:x(y,e),firefox:x(m,e),chrome:x(_,e),device:x(g,e)||x(v,e)||x(y,e)||x(m,e)||x(_,e)}};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}t.exports&&"undefined"==typeof window?t.exports=b:t.exports&&"undefined"!=typeof window?(t.exports=b(),t.exports.isMobile=b):(n=[],r=i.isMobile=b(),void 0===(o="function"==typeof r?r.apply(e,n):r)||(t.exports=o))}(this)},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var r=i(14),n=i(16);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=m,e.resolve=function(t,e){return m(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?m(t,!1,!0).resolveObject(e):e},e.format=function(t){n.isString(t)&&(t=m(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=i(17);function m(t,e,i){if(t&&n.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,i),r}o.prototype.parse=function(t,e,i){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var m=t=u.join(a);if(m=m.trim(),!i&&1===t.split("#").length){var x=h.exec(m);if(x)return this.path=m,this.href=m,this.pathname=x[1],x[2]?(this.search=x[2],this.query=e?_.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=s.exec(m);if(b){var w=(b=b[0]).toLowerCase();this.protocol=w,m=m.substr(b.length)}if(i||b||m.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===m.substr(0,2);!T||b&&v[b]||(m=m.substr(2),this.slashes=!0)}if(!v[b]&&(T||b&&!y[b])){for(var E,S,P=-1,A=0;A<d.length;A++){-1!==(C=m.indexOf(d[A]))&&(-1===P||C<P)&&(P=C)}-1!==(S=-1===P?m.lastIndexOf("@"):m.lastIndexOf("@",P))&&(E=m.slice(0,S),m=m.slice(S+1),this.auth=decodeURIComponent(E)),P=-1;for(A=0;A<c.length;A++){var C;-1!==(C=m.indexOf(c[A]))&&(-1===P||C<P)&&(P=C)}-1===P&&(P=m.length),this.host=m.slice(0,P),m=m.slice(P),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var I=this.hostname.split(/\./),M=(A=0,I.length);A<M;A++){var D=I[A];if(D&&!D.match(p)){for(var R="",k=0,F=D.length;k<F;k++)D.charCodeAt(k)>127?R+="x":R+=D[k];if(!R.match(p)){var L=I.slice(0,A),N=I.slice(A+1),B=D.match(f);B&&(L.push(B[1]),N.unshift(B[2])),N.length&&(m="/"+N.join(".")+m),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+U,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!g[w])for(A=0,M=l.length;A<M;A++){var H=l[A];if(-1!==m.indexOf(H)){var z=encodeURIComponent(H);z===H&&(z=escape(H)),m=m.split(H).join(z)}}var X=m.indexOf("#");-1!==X&&(this.hash=m.substr(X),m=m.slice(0,X));var G=m.indexOf("?");if(-1!==G?(this.search=m.substr(G),this.query=m.substr(G+1),e&&(this.query=_.parse(this.query)),m=m.slice(0,G)):e&&(this.search="",this.query={}),m&&(this.pathname=m),y[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var Y=this.search||"";this.path=U+Y}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&n.isObject(this.query)&&Object.keys(this.query).length&&(s=_.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(t){return this.resolveObject(m(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(n.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var i=new o,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(i[l]=t[l])}return y[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!y[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var p=c[d];i[p]=t[p]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||v[t.protocol])i.pathname=t.pathname;else{for(var f=(t.pathname||"").split("/");f.length&&!(t.host=f.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),i.pathname=f.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var g=i.pathname||"",_=i.search||"";i.path=g+_}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var m=i.pathname&&"/"===i.pathname.charAt(0),x=t.host||t.pathname&&"/"===t.pathname.charAt(0),b=x||m||i.host&&t.pathname,w=b,T=i.pathname&&i.pathname.split("/")||[],E=(f=t.pathname&&t.pathname.split("/")||[],i.protocol&&!y[i.protocol]);if(E&&(i.hostname="",i.port=null,i.host&&(""===T[0]?T[0]=i.host:T.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===f[0]?f[0]=t.host:f.unshift(t.host)),t.host=null),b=b&&(""===f[0]||""===T[0])),x)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,T=f;else if(f.length)T||(T=[]),T.pop(),T=T.concat(f),i.search=t.search,i.query=t.query;else if(!n.isNullOrUndefined(t.search)){if(E)i.hostname=i.host=T.shift(),(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift());return i.search=t.search,i.query=t.query,n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!T.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var S=T.slice(-1)[0],P=(i.host||t.host||T.length>1)&&("."===S||".."===S)||""===S,A=0,C=T.length;C>=0;C--)"."===(S=T[C])?T.splice(C,1):".."===S?(T.splice(C,1),A++):A&&(T.splice(C,1),A--);if(!b&&!w)for(;A--;A)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),P&&"/"!==T.join("/").substr(-1)&&T.push("");var O,I=""===T[0]||T[0]&&"/"===T[0].charAt(0);E&&(i.hostname=i.host=I?"":T.length?T.shift():"",(O=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=O.shift(),i.host=i.hostname=O.shift()));return(b=b||i.host&&T.length)&&!I&&T.unshift(""),T.length?i.pathname=T.join("/"):(i.pathname=null,i.path=null),n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,i){var r;
/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
!function(n,o,s,a){"use strict";var h,u=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),c="function",d=Math.round,p=Math.abs,f=Date.now;function g(t,e,i){return setTimeout(w(t,i),e)}function v(t,e,i){return!!Array.isArray(t)&&(y(t,i[e],i),!0)}function y(t,e,i){var r;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(r=0;r<t.length;)e.call(i,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(i,t[r],r,t)}function _(t,e,i){var r="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=n.console&&(n.console.warn||n.console.log);return o&&o.call(n.console,r,i),t.apply(this,arguments)}}h="function"!=typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==a&&null!==r)for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}:Object.assign;var m=_(function(t,e,i){for(var r=Object.keys(e),n=0;n<r.length;)(!i||i&&t[r[n]]===a)&&(t[r[n]]=e[r[n]]),n++;return t},"extend","Use `assign`."),x=_(function(t,e){return m(t,e,!0)},"merge","Use `assign`.");function b(t,e,i){var r,n=e.prototype;(r=t.prototype=Object.create(n)).constructor=t,r._super=n,i&&h(r,i)}function w(t,e){return function(){return t.apply(e,arguments)}}function T(t,e){return typeof t==c?t.apply(e&&e[0]||a,e):t}function E(t,e){return t===a?e:t}function S(t,e,i){y(O(e),function(e){t.addEventListener(e,i,!1)})}function P(t,e,i){y(O(e),function(e){t.removeEventListener(e,i,!1)})}function A(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function C(t,e){return t.indexOf(e)>-1}function O(t){return t.trim().split(/\s+/g)}function I(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var r=0;r<t.length;){if(i&&t[r][i]==e||!i&&t[r]===e)return r;r++}return-1}function M(t){return Array.prototype.slice.call(t,0)}function D(t,e,i){for(var r=[],n=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];I(n,s)<0&&r.push(t[o]),n[o]=s,o++}return i&&(r=e?r.sort(function(t,i){return t[e]>i[e]}):r.sort()),r}function R(t,e){for(var i,r,n=e[0].toUpperCase()+e.slice(1),o=0;o<u.length;){if((r=(i=u[o])?i+n:e)in t)return r;o++}return a}var k=1;function F(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}var L="ontouchstart"in n,N=R(n,"PointerEvent")!==a,B=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),U=25,j=1,H=2,z=4,X=8,G=1,Y=2,V=4,W=8,q=16,J=Y|V,Z=W|q,K=J|Z,Q=["x","y"],$=["clientX","clientY"];function tt(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){T(t.options.enable,[t])&&i.handler(e)},this.init()}function et(t,e,i){var r=i.pointers.length,n=i.changedPointers.length,o=e&j&&r-n==0,s=e&(z|X)&&r-n==0;i.isFirst=!!o,i.isFinal=!!s,o&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,r=e.pointers,n=r.length;i.firstInput||(i.firstInput=it(e));n>1&&!i.firstMultiple?i.firstMultiple=it(e):1===n&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,h=s?s.center:o.center,u=e.center=rt(r);e.timeStamp=f(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=at(h,u),e.distance=st(h,u),function(t,e){var i=e.center,r=t.offsetDelta||{},n=t.prevDelta||{},o=t.prevInput||{};e.eventType!==j&&o.eventType!==z||(n=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:i.x,y:i.y});e.deltaX=n.x+(i.x-r.x),e.deltaY=n.y+(i.y-r.y)}(i,e),e.offsetDirection=ot(e.deltaX,e.deltaY);var l=nt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=p(l.x)>p(l.y)?l.x:l.y,e.scale=s?(c=s.pointers,d=r,st(d[0],d[1],$)/st(c[0],c[1],$)):1,e.rotation=s?function(t,e){return at(e[1],e[0],$)+at(t[1],t[0],$)}(s.pointers,r):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,r,n,o,s=t.lastInterval||e,h=e.timeStamp-s.timeStamp;if(e.eventType!=X&&(h>U||s.velocity===a)){var u=e.deltaX-s.deltaX,l=e.deltaY-s.deltaY,c=nt(h,u,l);r=c.x,n=c.y,i=p(c.x)>p(c.y)?c.x:c.y,o=ot(u,l),t.lastInterval=e}else i=s.velocity,r=s.velocityX,n=s.velocityY,o=s.direction;e.velocity=i,e.velocityX=r,e.velocityY=n,e.direction=o}(i,e);var c,d;var g=t.element;A(e.srcEvent.target,g)&&(g=e.srcEvent.target);e.target=g}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function it(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:d(t.pointers[i].clientX),clientY:d(t.pointers[i].clientY)},i++;return{timeStamp:f(),pointers:e,center:rt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function rt(t){var e=t.length;if(1===e)return{x:d(t[0].clientX),y:d(t[0].clientY)};for(var i=0,r=0,n=0;n<e;)i+=t[n].clientX,r+=t[n].clientY,n++;return{x:d(i/e),y:d(r/e)}}function nt(t,e,i){return{x:e/t||0,y:i/t||0}}function ot(t,e){return t===e?G:p(t)>=p(e)?t<0?Y:V:e<0?W:q}function st(t,e,i){i||(i=Q);var r=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(r*r+n*n)}function at(t,e,i){i||(i=Q);var r=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,r)/Math.PI}tt.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(F(this.element),this.evWin,this.domHandler)}};var ht={mousedown:j,mousemove:H,mouseup:z},ut="mousedown",lt="mousemove mouseup";function ct(){this.evEl=ut,this.evWin=lt,this.pressed=!1,tt.apply(this,arguments)}b(ct,tt,{handler:function(t){var e=ht[t.type];e&j&&0===t.button&&(this.pressed=!0),e&H&&1!==t.which&&(e=z),this.pressed&&(e&z&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var dt={pointerdown:j,pointermove:H,pointerup:z,pointercancel:X,pointerout:X},pt={2:"touch",3:"pen",4:"mouse",5:"kinect"},ft="pointerdown",gt="pointermove pointerup pointercancel";function vt(){this.evEl=ft,this.evWin=gt,tt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(ft="MSPointerDown",gt="MSPointerMove MSPointerUp MSPointerCancel"),b(vt,tt,{handler:function(t){var e=this.store,i=!1,r=t.type.toLowerCase().replace("ms",""),n=dt[r],o=pt[t.pointerType]||t.pointerType,s="touch"==o,a=I(e,t.pointerId,"pointerId");n&j&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):n&(z|X)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var yt={touchstart:j,touchmove:H,touchend:z,touchcancel:X},_t="touchstart",mt="touchstart touchmove touchend touchcancel";function xt(){this.evTarget=_t,this.evWin=mt,this.started=!1,tt.apply(this,arguments)}b(xt,tt,{handler:function(t){var e=yt[t.type];if(e===j&&(this.started=!0),this.started){var i=function(t,e){var i=M(t.touches),r=M(t.changedTouches);e&(z|X)&&(i=D(i.concat(r),"identifier",!0));return[i,r]}.call(this,t,e);e&(z|X)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}}});var bt={touchstart:j,touchmove:H,touchend:z,touchcancel:X},wt="touchstart touchmove touchend touchcancel";function Tt(){this.evTarget=wt,this.targetIds={},tt.apply(this,arguments)}b(Tt,tt,{handler:function(t){var e=bt[t.type],i=function(t,e){var i=M(t.touches),r=this.targetIds;if(e&(j|H)&&1===i.length)return r[i[0].identifier]=!0,[i,i];var n,o,s=M(t.changedTouches),a=[],h=this.target;if(o=i.filter(function(t){return A(t.target,h)}),e===j)for(n=0;n<o.length;)r[o[n].identifier]=!0,n++;n=0;for(;n<s.length;)r[s[n].identifier]&&a.push(s[n]),e&(z|X)&&delete r[s[n].identifier],n++;if(!a.length)return;return[D(o.concat(a),"identifier",!0),a]}.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:"touch",srcEvent:t})}});var Et=2500,St=25;function Pt(){tt.apply(this,arguments);var t=w(this.handler,this);this.touch=new Tt(this.manager,t),this.mouse=new ct(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function At(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var r=this.lastTouches;setTimeout(function(){var t=r.indexOf(i);t>-1&&r.splice(t,1)},Et)}}b(Pt,tt,{handler:function(t,e,i){var r="touch"==i.pointerType,n="mouse"==i.pointerType;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(r)(function(t,e){t&j?(this.primaryTouch=e.changedPointers[0].identifier,At.call(this,e)):t&(z|X)&&At.call(this,e)}).call(this,e,i);else if(n&&function(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],o=Math.abs(e-n.x),s=Math.abs(i-n.y);if(o<=St&&s<=St)return!0}return!1}.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Ct=R(l.style,"touchAction"),Ot=Ct!==a,It="auto",Mt="manipulation",Dt="none",Rt="pan-x",kt="pan-y",Ft=function(){if(!Ot)return!1;var t={},e=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!e||n.CSS.supports("touch-action",i)}),t}();function Lt(t,e){this.manager=t,this.set(e)}Lt.prototype={set:function(t){"compute"==t&&(t=this.compute()),Ot&&this.manager.element.style&&Ft[t]&&(this.manager.element.style[Ct]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return y(this.manager.recognizers,function(e){T(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(C(t,Dt))return Dt;var e=C(t,Rt),i=C(t,kt);if(e&&i)return Dt;if(e||i)return e?Rt:kt;if(C(t,Mt))return Mt;return It}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,n=C(r,Dt)&&!Ft[Dt],o=C(r,kt)&&!Ft[kt],s=C(r,Rt)&&!Ft[Rt];if(n){var a=1===t.pointers.length,h=t.distance<2,u=t.deltaTime<250;if(a&&h&&u)return}if(!s||!o)return n||o&&i&J||s&&i&Z?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Nt=1,Bt=2,Ut=4,jt=8,Ht=jt,zt=16;function Xt(t){this.options=h({},this.defaults,t||{}),this.id=k++,this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=Nt,this.simultaneous={},this.requireFail=[]}function Gt(t){return t&zt?"cancel":t&jt?"end":t&Ut?"move":t&Bt?"start":""}function Yt(t){return t==q?"down":t==W?"up":t==Y?"left":t==V?"right":""}function Vt(t,e){var i=e.manager;return i?i.get(t):t}function Wt(){Xt.apply(this,arguments)}function qt(){Wt.apply(this,arguments),this.pX=null,this.pY=null}function Jt(){Wt.apply(this,arguments)}function Zt(){Xt.apply(this,arguments),this._timer=null,this._input=null}function Kt(){Wt.apply(this,arguments)}function Qt(){Wt.apply(this,arguments)}function $t(){Xt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function te(t,e){return(e=e||{}).recognizers=E(e.recognizers,te.defaults.preset),new ee(t,e)}Xt.prototype={defaults:{},set:function(t){return h(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(v(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Vt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return v(t,"dropRecognizeWith",this)?this:(t=Vt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(v(t,"requireFailure",this))return this;var e=this.requireFail;return-1===I(e,t=Vt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(v(t,"dropRequireFailure",this))return this;t=Vt(t,this);var e=I(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function r(i){e.manager.emit(i,t)}i<jt&&r(e.options.event+Gt(i)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),i>=jt&&r(e.options.event+Gt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|Nt)))return!1;t++}return!0},recognize:function(t){var e=h({},t);if(!T(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(Ht|zt|32)&&(this.state=Nt),this.state=this.process(e),this.state&(Bt|Ut|jt|zt)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(Wt,Xt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,r=e&(Bt|Ut),n=this.attrTest(t);return r&&(i&X||!n)?e|zt:r||n?i&z?e|jt:e&Bt?e|Ut:Bt:32}}),b(qt,Wt,{defaults:{event:"pan",threshold:10,pointers:1,direction:K},getTouchAction:function(){var t=this.options.direction,e=[];return t&J&&e.push(kt),t&Z&&e.push(Rt),e},directionTest:function(t){var e=this.options,i=!0,r=t.distance,n=t.direction,o=t.deltaX,s=t.deltaY;return n&e.direction||(e.direction&J?(n=0===o?G:o<0?Y:V,i=o!=this.pX,r=Math.abs(t.deltaX)):(n=0===s?G:s<0?W:q,i=s!=this.pY,r=Math.abs(t.deltaY))),t.direction=n,i&&r>e.threshold&&n&e.direction},attrTest:function(t){return Wt.prototype.attrTest.call(this,t)&&(this.state&Bt||!(this.state&Bt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Yt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),b(Jt,Wt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&Bt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),b(Zt,Xt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[It]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,r=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!r||!i||t.eventType&(z|X)&&!n)this.reset();else if(t.eventType&j)this.reset(),this._timer=g(function(){this.state=Ht,this.tryEmit()},e.time,this);else if(t.eventType&z)return Ht;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Ht&&(t&&t.eventType&z?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}}),b(Kt,Wt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&Bt)}}),b(Qt,Wt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:J|Z,pointers:1},getTouchAction:function(){return qt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(J|Z)?e=t.overallVelocity:i&J?e=t.overallVelocityX:i&Z&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&t.eventType&z},emit:function(t){var e=Yt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),b($t,Xt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Mt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,r=t.distance<e.threshold,n=t.deltaTime<e.time;if(this.reset(),t.eventType&j&&0===this.count)return this.failTimeout();if(r&&n&&i){if(t.eventType!=z)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||st(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=g(function(){this.state=Ht,this.tryEmit()},e.interval,this),Bt):Ht}return 32},failTimeout:function(){return this._timer=g(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),te.VERSION="2.0.7",te.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[Kt,{enable:!1}],[Jt,{enable:!1},["rotate"]],[Qt,{direction:J}],[qt,{direction:J},["swipe"]],[$t],[$t,{event:"doubletap",taps:2},["tap"]],[Zt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function ee(t,e){var i;this.options=h({},te.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(N?vt:B?Tt:L?Pt:ct))(i,et),this.touchAction=new Lt(this,this.options.touchAction),ie(this,!0),y(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function ie(t,e){var i,r=t.element;r.style&&(y(t.options.cssProps,function(n,o){i=R(r.style,o),e?(t.oldCssProps[i]=r.style[i],r.style[i]=n):r.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}ee.prototype={set:function(t){return h(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var r=this.recognizers,n=e.curRecognizer;(!n||n&&n.state&Ht)&&(n=e.curRecognizer=null);for(var o=0;o<r.length;)i=r[o],2===e.stopped||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(t),!n&&i.state&(Bt|Ut|jt)&&(n=e.curRecognizer=i),o++}},get:function(t){if(t instanceof Xt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(v(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(v(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=I(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return y(O(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==a){var i=this.handlers;return y(O(t),function(t){e?i[t]&&i[t].splice(I(i[t],e),1):delete i[t]}),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var i=o.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](e),r++}},destroy:function(){this.element&&ie(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(te,{INPUT_START:j,INPUT_MOVE:H,INPUT_END:z,INPUT_CANCEL:X,STATE_POSSIBLE:Nt,STATE_BEGAN:Bt,STATE_CHANGED:Ut,STATE_ENDED:jt,STATE_RECOGNIZED:Ht,STATE_CANCELLED:zt,STATE_FAILED:32,DIRECTION_NONE:G,DIRECTION_LEFT:Y,DIRECTION_RIGHT:V,DIRECTION_UP:W,DIRECTION_DOWN:q,DIRECTION_HORIZONTAL:J,DIRECTION_VERTICAL:Z,DIRECTION_ALL:K,Manager:ee,Input:tt,TouchAction:Lt,TouchInput:Tt,MouseInput:ct,PointerEventInput:vt,TouchMouseInput:Pt,SingleTouchInput:xt,Recognizer:Xt,AttrRecognizer:Wt,Tap:$t,Pan:qt,Swipe:Qt,Pinch:Jt,Rotate:Kt,Press:Zt,on:S,off:P,each:y,merge:x,extend:m,assign:h,inherit:b,bindFn:w,prefixed:R}),(void 0!==n?n:"undefined"!=typeof self?self:{}).Hammer=te,(r=function(){return te}.call(e,i,e,t))===a||(t.exports=r)}(window,document)},function(t,e,i){"use strict";t.exports=function(t,e){e=e||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[i.key[o]]=r[o]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(t,e,r){e&&(n[i.q.name][e]=r)}),n}},function(t,e,i){"use strict";var r=Object.prototype.hasOwnProperty,n="~";function o(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,r,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,r||t,o),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function u(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)r.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},u.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},u.prototype.emit=function(t,e,i,r,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,r),!0;case 5:return l.fn.call(l.context,e,i,r,o),!0;case 6:return l.fn.call(l.context,e,i,r,o,s),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,i);break;case 4:l[u].fn.call(l[u].context,e,i,r);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];l[u].fn.apply(l[u].context,h)}}return!0},u.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return h(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||h(this,o);else{for(var a=0,u=[],l=s.length;a<l;a++)(s[a].fn!==e||r&&!s[a].once||i&&s[a].context!==i)&&u.push(s[a]);u.length?this._events[o]=1===u.length?u[0]:u:h(this,o)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&h(this,e)):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u},function(t,e,i){"use strict";function r(t,e,i){i=i||2;var r,a,h,u,l,p,g,v=e&&e.length,y=v?e[0]*i:t.length,_=n(t,0,y,i,!0),m=[];if(!_||_.next===_.prev)return m;if(v&&(_=function(t,e,i,r){var s,a,h,u,l,p=[];for(s=0,a=e.length;s<a;s++)h=e[s]*r,u=s<a-1?e[s+1]*r:t.length,(l=n(t,h,u,r,!1))===l.next&&(l.steiner=!0),p.push(f(l));for(p.sort(c),s=0;s<p.length;s++)d(p[s],i),i=o(i,i.next);return i}(t,e,_,i)),t.length>80*i){r=h=t[0],a=u=t[1];for(var x=i;x<y;x+=i)(l=t[x])<r&&(r=l),(p=t[x+1])<a&&(a=p),l>h&&(h=l),p>u&&(u=p);g=0!==(g=Math.max(h-r,u-a))?1/g:0}return s(_,m,i,r,a,g),m}function n(t,e,i,r,n){var o,s;if(n===S(t,e,i,r)>0)for(o=e;o<i;o+=r)s=w(o,t[o],t[o+1],s);else for(o=i-r;o>=e;o-=r)s=w(o,t[o],t[o+1],s);return s&&_(s,s.next)&&(T(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!_(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(T(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,r,n,c,d){if(t){!d&&c&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=p(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,o,s,a,h,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,r=i,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(s>1)}(n)}(t,r,n,c);for(var f,g,v=t;t.prev!==t.next;)if(f=t.prev,g=t.next,c?h(t,r,n,c):a(t))e.push(f.i/i),e.push(t.i/i),e.push(g.i/i),T(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?s(t=u(t,e,i),e,i,r,n,c,2):2===d&&l(t,e,i,r,n,c):s(o(t),e,i,r,n,c,1);break}}}function a(t){var e=t.prev,i=t,r=t.next;if(y(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(g(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&y(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,i,r){var n=t.prev,o=t,s=t.next;if(y(n,o,s)>=0)return!1;for(var a=n.x<o.x?n.x<s.x?n.x:s.x:o.x<s.x?o.x:s.x,h=n.y<o.y?n.y<s.y?n.y:s.y:o.y<s.y?o.y:s.y,u=n.x>o.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=p(a,h,e,i,r),d=p(u,l,e,i,r),f=t.prevZ,v=t.nextZ;f&&f.z>=c&&v&&v.z<=d;){if(f!==t.prev&&f!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,v!==t.prev&&v!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,v.x,v.y)&&y(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,v.x,v.y)&&y(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function u(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!_(n,o)&&m(n,r,r.next,o)&&x(n,o)&&x(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),T(r),T(r.next),r=t=o),r=r.next}while(r!==t);return r}function l(t,e,i,r,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&v(h,u)){var l=b(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,i,r,n,a),void s(l,e,i,r,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>s){if(s=a,a===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(n===s)return i.prev;var h,u=i,l=i.x,c=i.y,d=1/0;r=i.next;for(;r!==u;)n>=r.x&&r.x>=l&&n!==r.x&&g(o<c?n:s,o,l,c,o<c?s:n,o,r.x,r.y)&&((h=Math.abs(o-r.y)/(n-r.x))<d||h===d&&r.x>i.x)&&x(r,t)&&(i=r,d=h),r=r.next;return i}(t,e)){var i=b(e,t);o(i,i.next)}}function p(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,r,n,o,s,a){return(n-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(n-s)*(r-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&m(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function m(t,e,i,r){return!!(_(t,e)&&_(i,r)||_(t,r)&&_(i,e))||y(t,e,i)>0!=y(t,e,r)>0&&y(i,r,t)>0!=y(i,r,e)>0}function x(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function w(t,e,i,r){var n=new E(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function T(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,r){for(var n=0,o=e,s=i-r;o<i;o+=r)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}t.exports=r,t.exports.default=r,r.deviation=function(t,e,i,r){var n=e&&e.length,o=n?e[0]*i:t.length,s=Math.abs(S(t,0,o,i));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*i,l=a<h-1?e[a+1]*i:t.length;s-=Math.abs(S(t,u,l,i))}var c=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,f=r[a+2]*i;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},r.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[n][o][s]);n>0&&(r+=t[n-1].length,i.holes.push(r))}return i}},function(t,e,i){(function(r,n){var o;!function(r){var s=r.Promise,a=s&&"resolve"in s&&"reject"in s&&"all"in s&&"race"in s&&function(){var t;return new s(function(e){t=e}),"function"==typeof t}();e?(e.Promise=a?s:A,e.Polyfill=A):void 0===(o=function(){return a?s:A}.call(e,i,e,t))||(t.exports=o);var h="pending",u="sealed",l="fulfilled",c="rejected",d=function(){};function p(t){return"[object Array]"===Object.prototype.toString.call(t)}var f,g=void 0!==n?n:setTimeout,v=[];function y(){for(var t=0;t<v.length;t++)v[t][0](v[t][1]);v=[],f=!1}function _(t,e){v.push([t,e]),f||(f=!0,g(y,0))}function m(t){var e=t.owner,i=e.state_,r=e.data_,n=t[i],o=t.then;if("function"==typeof n){i=l;try{r=n(r)}catch(t){T(o,t)}}x(o,r)||(i===l&&b(o,r),i===c&&T(o,r))}function x(t,e){var i;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(r){i||(i=!0,e!==r?b(t,r):w(t,r))},function(e){i||(i=!0,T(t,e))}),!0}}catch(e){return i||T(t,e),!0}return!1}function b(t,e){t!==e&&x(t,e)||w(t,e)}function w(t,e){t.state_===h&&(t.state_=u,t.data_=e,_(S,t))}function T(t,e){t.state_===h&&(t.state_=u,t.data_=e,_(P,t))}function E(t){var e=t.then_;t.then_=void 0;for(var i=0;i<e.length;i++)m(e[i])}function S(t){t.state_=l,E(t)}function P(t){t.state_=c,E(t)}function A(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof A==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],function(t,e){function i(t){T(e,t)}try{t(function(t){b(e,t)},i)}catch(t){i(t)}}(t,this)}A.prototype={constructor:A,state_:h,then_:null,data_:void 0,then:function(t,e){var i={owner:this,then:new this.constructor(d),fulfilled:t,rejected:e};return this.state_===l||this.state_===c?_(m,i):this.then_.push(i),i.then},catch:function(t){return this.then(null,t)}},A.all=function(t){if(!p(t))throw new TypeError("You must pass an array to Promise.all().");return new this(function(e,i){var r=[],n=0;function o(t){return n++,function(i){r[t]=i,--n||e(r)}}for(var s,a=0;a<t.length;a++)(s=t[a])&&"function"==typeof s.then?s.then(o(a),i):r[a]=s;n||e(r)})},A.race=function(t){if(!p(t))throw new TypeError("You must pass an array to Promise.race().");return new this(function(e,i){for(var r,n=0;n<t.length;n++)(r=t[n])&&"function"==typeof r.then?r.then(e,i):e(r)})},A.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this(function(e){e(t)})},A.reject=function(t){return new this(function(e,i){i(t)})}}("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this)}).call(this,i(2),i(11).setImmediate)},function(t,e,i){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,s,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),h=1;h<arguments.length;h++){for(var u in i=Object(arguments[h]))n.call(i,u)&&(a[u]=i[u]);if(r){s=r(i);for(var l=0;l<s.length;l++)o.call(i,s[l])&&(a[s[l]]=i[s[l]])}}return a}},function(t,e,i){"use strict";(function(t){var e=i(8),r=i(9),n=i.n(r);
/*!
 * @pixi/polyfill - v5.1.0
 * Compiled Fri, 19 Jul 2019 21:54:36 UTC
 *
 * @pixi/polyfill is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
window.Promise||(window.Promise=e.Polyfill),Object.assign||(Object.assign=n.a);var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!o.performance||!o.performance.now){var s=Date.now();o.performance||(o.performance={}),o.performance.now=function(){return Date.now()-s}}for(var a=Date.now(),h=["ms","moz","webkit","o"],u=0;u<h.length&&!o.requestAnimationFrame;++u){var l=h[u];o.requestAnimationFrame=o[l+"RequestAnimationFrame"],o.cancelAnimationFrame=o[l+"CancelAnimationFrame"]||o[l+"CancelRequestAnimationFrame"]}o.requestAnimationFrame||(o.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+a-e;return i<0&&(i=0),a=e,setTimeout(function(){a=Date.now(),t(performance.now())},i)}),o.cancelAnimationFrame||(o.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array)}).call(this,i(2))},function(t,e,i){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(n.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(n.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},i(12),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(2))},function(t,e,i){(function(t,e){!function(t,i){"use strict";if(!t.setImmediate){var r,n,o,s,a,h=1,u={},l=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){f(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){f(t.data)},r=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,r=function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):r=function(t){setTimeout(f,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&f(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var n={callback:t,args:e};return u[h]=n,r(h),h++},d.clearImmediate=p}function p(t){delete u[t]}function f(t){if(l)setTimeout(f,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(i,r)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(2),i(13))},function(t,e){var i,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var h,u=[],l=!1,c=-1;function d(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=a(d);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new f(t,e)),1!==u.length||l||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,i){(function(t,r){var n;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,h=2147483647,u=36,l=1,c=26,d=38,p=700,f=72,g=128,v="-",y=/^xn--/,_=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-l,w=Math.floor,T=String.fromCharCode;function E(t){throw new RangeError(x[t])}function S(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function P(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+S((t=t.replace(m,".")).split("."),e).join(".")}function A(t){for(var e,i,r=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(i=t.charCodeAt(n++)))?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--):r.push(e);return r}function C(t){return S(t,function(t){var e="";return t>65535&&(e+=T((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=T(t)}).join("")}function O(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,i){var r=0;for(t=i?w(t/p):t>>1,t+=w(t/e);t>b*c>>1;r+=u)t=w(t/b);return w(r+(b+1)*t/(t+d))}function M(t){var e,i,r,n,o,s,a,d,p,y,_,m=[],x=t.length,b=0,T=g,S=f;for((i=t.lastIndexOf(v))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&E("not-basic"),m.push(t.charCodeAt(r));for(n=i>0?i+1:0;n<x;){for(o=b,s=1,a=u;n>=x&&E("invalid-input"),((d=(_=t.charCodeAt(n++))-48<10?_-22:_-65<26?_-65:_-97<26?_-97:u)>=u||d>w((h-b)/s))&&E("overflow"),b+=d*s,!(d<(p=a<=S?l:a>=S+c?c:a-S));a+=u)s>w(h/(y=u-p))&&E("overflow"),s*=y;S=I(b-o,e=m.length+1,0==o),w(b/e)>h-T&&E("overflow"),T+=w(b/e),b%=e,m.splice(b++,0,T)}return C(m)}function D(t){var e,i,r,n,o,s,a,d,p,y,_,m,x,b,S,P=[];for(m=(t=A(t)).length,e=g,i=0,o=f,s=0;s<m;++s)(_=t[s])<128&&P.push(T(_));for(r=n=P.length,n&&P.push(v);r<m;){for(a=h,s=0;s<m;++s)(_=t[s])>=e&&_<a&&(a=_);for(a-e>w((h-i)/(x=r+1))&&E("overflow"),i+=(a-e)*x,e=a,s=0;s<m;++s)if((_=t[s])<e&&++i>h&&E("overflow"),_==e){for(d=i,p=u;!(d<(y=p<=o?l:p>=o+c?c:p-o));p+=u)S=d-y,b=u-y,P.push(T(O(y+S%b,0))),d=w(S/b);P.push(T(O(d,0))),o=I(i,x,r==n),i=0,++r}++i,++e}return P.join("")}a={version:"1.4.1",ucs2:{decode:A,encode:C},decode:M,encode:D,toASCII:function(t){return P(t,function(t){return _.test(t)?"xn--"+D(t):t})},toUnicode:function(t){return P(t,function(t){return y.test(t)?M(t.slice(4).toLowerCase()):t})}},void 0===(n=function(){return a}.call(e,i,e,t))||(t.exports=n)}()}).call(this,i(15)(t),i(2))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,i){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,i){"use strict";e.decode=e.parse=i(18),e.encode=e.stringify=i(19)},function(t,e,i){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,i,o){e=e||"&",i=i||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,d,p,f,g=t[l].replace(a,"%20"),v=g.indexOf(i);v>=0?(c=g.substr(0,v),d=g.substr(v+1)):(c=g,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),r(s,p)?n(s[p])?s[p].push(f):s[p]=[s[p],f]:s[p]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,i){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,i,a){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var a=encodeURIComponent(r(s))+i;return n(t[s])?o(t[s],function(t){return a+encodeURIComponent(r(t))}).join(e):a+encodeURIComponent(r(t[s]))}).join(e):a?encodeURIComponent(r(a))+i+encodeURIComponent(r(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var i=[],r=0;r<t.length;r++)i.push(e(t[r],r));return i}var s=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}},function(t,e,i){"use strict";i.r(e);var r={};i.r(r),i.d(r,"isMobile",function(){return c.a}),i.d(r,"EventEmitter",function(){return f.a}),i.d(r,"earcut",function(){return v.a}),i.d(r,"url",function(){return _.a}),i.d(r,"BaseTextureCache",function(){return nt}),i.d(r,"CanvasRenderTarget",function(){return ht}),i.d(r,"DATA_URI",function(){return ct}),i.d(r,"ProgramCache",function(){return it}),i.d(r,"TextureCache",function(){return rt}),i.d(r,"clearTextureCache",function(){return st}),i.d(r,"correctBlendMode",function(){return G}),i.d(r,"createIndicesForQuads",function(){return q}),i.d(r,"decomposeDataUri",function(){return dt}),i.d(r,"deprecation",function(){return vt}),i.d(r,"destroyTextureCache",function(){return ot}),i.d(r,"determineCrossOrigin",function(){return pt}),i.d(r,"getResolutionOfUrl",function(){return ft}),i.d(r,"hex2rgb",function(){return U}),i.d(r,"hex2string",function(){return j}),i.d(r,"isPow2",function(){return tt}),i.d(r,"isWebGLSupported",function(){return B}),i.d(r,"log2",function(){return et}),i.d(r,"nextPow2",function(){return $}),i.d(r,"premultiplyBlendMode",function(){return X}),i.d(r,"premultiplyRgba",function(){return Y}),i.d(r,"premultiplyTint",function(){return V}),i.d(r,"premultiplyTintToRgba",function(){return W}),i.d(r,"removeItems",function(){return J}),i.d(r,"rgb2hex",function(){return z}),i.d(r,"sayHello",function(){return N}),i.d(r,"sign",function(){return Q}),i.d(r,"skipHello",function(){return L}),i.d(r,"string2hex",function(){return H}),i.d(r,"trimCanvas",function(){return at}),i.d(r,"uid",function(){return K});var n={};i.r(n),i.d(n,"AccessibilityManager",function(){return qt}),i.d(n,"accessibleTarget",function(){return Wt});var o={};i.r(o),i.d(o,"Extract",function(){return vr});var s={};i.r(s),i.d(s,"InteractionData",function(){return yr}),i.d(s,"InteractionEvent",function(){return mr}),i.d(s,"InteractionManager",function(){return Sr}),i.d(s,"InteractionTrackingData",function(){return xr}),i.d(s,"interactiveTarget",function(){return wr});var a={};i.r(a),i.d(a,"BasePrepare",function(){return dn}),i.d(a,"CountLimiter",function(){return cn}),i.d(a,"Prepare",function(){return xn}),i.d(a,"TimeLimiter",function(){return En});var h={};i.r(h),i.d(h,"CanvasExtract",function(){return Ko});var u={};i.r(u),i.d(u,"CanvasPrepare",function(){return $o});i(10);var l=i(1),c=i.n(l);var d={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:
/*!
 * @pixi/settings - v5.1.1
 * Compiled Fri, 02 Aug 2019 23:20:23 UTC
 *
 * @pixi/settings is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
function(t){var e=!0;if(c.a.tablet||c.a.phone){if(e=!1,c.a.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(c.a.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:c.a.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!c.a.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},p=i(6),f=i.n(p),g=i(7),v=i.n(g),y=i(3),_=i.n(y),m={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},x={UNKNOWN:0,WEBGL:1,CANVAS:2},b={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},w={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},T={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},E={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},S={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},P=1,A=0,C=33071,O=10497,I=1,M=1,D={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};
/*!
 * @pixi/utils - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/utils is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
d.RETINA_PREFIX=/@([0-9\.]+)x/,d.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var R,k=!1,F="5.1.2";function L(){k=!0}function N(t){if(!k){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+F+" - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+F+" - "+t+" - http://www.pixijs.com/");k=!0}}function B(){return void 0===R&&(R=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:d.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),R}function U(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function j(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function H(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function z(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var X=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[b.NORMAL_NPM]=b.NORMAL,t[b.ADD_NPM]=b.ADD,t[b.SCREEN_NPM]=b.SCREEN,e[b.NORMAL]=b.NORMAL_NPM,e[b.ADD]=b.ADD_NPM,e[b.SCREEN]=b.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function G(t,e){return X[e?1:0][t]}function Y(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function V(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function W(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function q(t,e){void 0===e&&(e=null);var i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var r=0,n=0;r<i;r+=6,n+=4)e[r+0]=n+0,e[r+1]=n+1,e[r+2]=n+2,e[r+3]=n+0,e[r+4]=n+2,e[r+5]=n+3;return e}function J(t,e,i){var r,n=t.length;if(!(e>=n||0===i)){var o=n-(i=e+i>n?n-e:i);for(r=e;r<o;++r)t[r]=t[r+i];t.length=o}}var Z=0;function K(){return++Z}function Q(t){return 0===t?0:t<0?-1:1}function $(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function tt(t){return!(t&t-1||!t)}function et(t){var e=(t>65535)<<4,i=((t>>>=e)>255)<<3;return e|=i,e|=i=((t>>>=i)>15)<<2,(e|=i=((t>>>=i)>3)<<1)|(t>>>=i)>>1}var it={},rt=Object.create(null),nt=Object.create(null);function ot(){var t;for(t in rt)rt[t].destroy();for(t in nt)nt[t].destroy()}function st(){var t;for(t in rt)delete rt[t];for(t in nt)delete nt[t]}function at(t){var e,i,r,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(i=e/4%n,r=~~(e/4/n),null===u.top&&(u.top=r),null===u.left?u.left=i:i<u.left&&(u.left=i),null===u.right?u.right=i+1:u.right<i&&(u.right=i+1),null===u.bottom?u.bottom=r:u.bottom<r&&(u.bottom=r));return null!==u.top&&(n=u.right-u.left,o=u.bottom-u.top+1,l=s.getImageData(u.left,u.top,n,o)),{height:o,width:n,data:l}}var ht=function(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||d.RESOLUTION,this.resize(t,e)},ut={width:{configurable:!0},height:{configurable:!0}};ht.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},ht.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},ht.prototype.destroy=function(){this.context=null,this.canvas=null},ut.width.get=function(){return this.canvas.width},ut.width.set=function(t){this.canvas.width=t},ut.height.get=function(){return this.canvas.height},ut.height.set=function(t){this.canvas.height=t},Object.defineProperties(ht.prototype,ut);var lt,ct=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function dt(t){var e=ct.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function pt(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,lt||(lt=document.createElement("a")),lt.href=t;var i=!(t=_.a.parse(lt.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&i&&t.protocol===e.protocol?"":"anonymous"}function ft(t,e){var i=d.RETINA_PREFIX.exec(t);return i?parseFloat(i[1]):void 0!==e?e:1}var gt={};function vt(t,e,i){if(void 0===i&&(i=3),!gt[e]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(i).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),gt[e]=!0}}
/*!
 * @pixi/math - v5.1.0
 * Compiled Fri, 19 Jul 2019 21:54:36 UTC
 *
 * @pixi/math is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */var yt=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e};yt.prototype.clone=function(){return new yt(this.x,this.y)},yt.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},yt.prototype.copyTo=function(t){return t.set(this.x,this.y),t},yt.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},yt.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)};var _t=function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._x=i,this._y=r,this.cb=t,this.scope=e},mt={x:{configurable:!0},y:{configurable:!0}};_t.prototype.clone=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=t||this.cb,r=e||this.scope;return new _t(i,r,this._x,this._y)},_t.prototype.set=function(t,e){var i=t||0,r=e||(0!==e?i:0);this._x===i&&this._y===r||(this._x=i,this._y=r,this.cb.call(this.scope))},_t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},_t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},_t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},mt.x.get=function(){return this._x},mt.x.set=function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},mt.y.get=function(){return this._y},mt.y.set=function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},Object.defineProperties(_t.prototype,mt);var xt=2*Math.PI,bt=180/Math.PI,wt=Math.PI/180,Tt={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},Et=function(t,e,i,r,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===o&&(o=0),this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o,this.array=null},St={IDENTITY:{configurable:!0},TEMP_MATRIX:{configurable:!0}};Et.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},Et.prototype.set=function(t,e,i,r,n,o){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o,this},Et.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},Et.prototype.apply=function(t,e){e=e||new yt;var i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e},Et.prototype.applyInverse=function(t,e){e=e||new yt;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},Et.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},Et.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},Et.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.a,n=this.c,o=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},Et.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},Et.prototype.setTransform=function(t,e,i,r,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},Et.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},Et.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,o=-Math.atan2(-r,n),s=Math.atan2(i,e),a=Math.abs(o+s);return a<1e-5||Math.abs(xt-a)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx,t.position.y=this.ty,t},Et.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,o=t*r-e*i;return this.a=r/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-r*n)/o,this.ty=-(t*this.ty-e*n)/o,this},Et.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},Et.prototype.clone=function(){var t=new Et;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},Et.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},Et.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},St.IDENTITY.get=function(){return new Et},St.TEMP_MATRIX.get=function(){return new Et},Object.defineProperties(Et,St);var Pt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],At=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ct=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ot=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],It=[],Mt=[],Dt=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];It.push(e);for(var i=0;i<16;i++)for(var r=Dt(Pt[t]*Pt[i]+Ct[t]*At[i]),n=Dt(At[t]*Pt[i]+Ot[t]*At[i]),o=Dt(Pt[t]*Ct[i]+Ct[t]*Ot[i]),s=Dt(At[t]*Ct[i]+Ot[t]*Ot[i]),a=0;a<16;a++)if(Pt[a]===r&&At[a]===n&&Ct[a]===o&&Ot[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new Et;u.set(Pt[h],At[h],Ct[h],Ot[h],0,0),Mt.push(u)}}();var Rt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return Pt[t]},uY:function(t){return At[t]},vX:function(t){return Ct[t]},vY:function(t){return Ot[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return It[t][e]},sub:function(t,e){return It[t][Rt.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?Rt.S:Rt.N:2*Math.abs(e)<=Math.abs(t)?t>0?Rt.E:Rt.W:e>0?t>0?Rt.SE:Rt.SW:t>0?Rt.NE:Rt.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=Mt[Rt.inv(e)];n.tx=i,n.ty=r,t.append(n)}},kt=function(){this.worldTransform=new Et,this.localTransform=new Et,this.position=new _t(this.onChange,this,0,0),this.scale=new _t(this.onChange,this,1,1),this.pivot=new _t(this.onChange,this,0,0),this.skew=new _t(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},Ft={rotation:{configurable:!0}};kt.prototype.onChange=function(){this._localID++},kt.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},kt.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},kt.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},kt.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ft.rotation.get=function(){return this._rotation},Ft.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(kt.prototype,Ft),kt.IDENTITY=new kt;var Lt=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=Tt.RECT},Nt={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Bt={EMPTY:{configurable:!0}};Nt.left.get=function(){return this.x},Nt.right.get=function(){return this.x+this.width},Nt.top.get=function(){return this.y},Nt.bottom.get=function(){return this.y+this.height},Bt.EMPTY.get=function(){return new Lt(0,0,0,0)},Lt.prototype.clone=function(){return new Lt(this.x,this.y,this.width,this.height)},Lt.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Lt.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Lt.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},Lt.prototype.pad=function(t,e){t=t||0,e=e||(0!==e?t:0),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e},Lt.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0)},Lt.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y},Lt.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=i-e,this.y=r,this.height=n-r},Object.defineProperties(Lt.prototype,Nt),Object.defineProperties(Lt,Bt);var Ut=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=Tt.CIRC};Ut.prototype.clone=function(){return new Ut(this.x,this.y,this.radius)},Ut.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return(r*=r)+(n*=n)<=i},Ut.prototype.getBounds=function(){return new Lt(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)};var jt=function(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.width=i,this.height=r,this.type=Tt.ELIP};jt.prototype.clone=function(){return new jt(this.x,this.y,this.width,this.height)},jt.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,r=(e-this.y)/this.height;return(i*=i)+(r*=r)<=1},jt.prototype.getBounds=function(){return new Lt(this.x-this.width,this.y-this.height,this.width,this.height)};var Ht=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];if(Array.isArray(t[0])&&(t=t[0]),t[0]instanceof yt){for(var i=[],r=0,n=t.length;r<n;r++)i.push(t[r].x,t[r].y);t=i}this.points=t,this.type=Tt.POLY,this.closeStroke=!0};Ht.prototype.clone=function(){var t=new Ht(this.points.slice());return t.closeStroke=this.closeStroke,t},Ht.prototype.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,o=r-1;n<r;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i};var zt=function(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=Tt.RREC};zt.prototype.clone=function(){return new zt(this.x,this.y,this.width,this.height,this.radius)},zt.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},
/*!
 * @pixi/display - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/display is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
d.SORTABLE_CHILDREN=!1;var Xt=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Xt.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Xt.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Xt.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Lt.EMPTY:((t=t||new Lt(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Xt.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Xt.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,i=s<i?s:i,r=o>r?o:r,n=s>n?s:n,e=(o=t[2])<e?o:e,i=(s=t[3])<i?s:i,r=o>r?o:r,n=s>n?s:n,e=(o=t[4])<e?o:e,i=(s=t[5])<i?s:i,r=o>r?o:r,n=s>n?s:n,e=(o=t[6])<e?o:e,i=(s=t[7])<i?s:i,r=o>r?o:r,n=s>n?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Xt.prototype.addFrame=function(t,e,i,r,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,g=this.maxY,v=s*e+h*i+l,y=a*e+u*i+c;d=v<d?v:d,p=y<p?y:p,f=v>f?v:f,g=y>g?y:g,d=(v=s*r+h*i+l)<d?v:d,p=(y=a*r+u*i+c)<p?y:p,f=v>f?v:f,g=y>g?y:g,d=(v=s*e+h*n+l)<d?v:d,p=(y=a*e+u*n+c)<p?y:p,f=v>f?v:f,g=y>g?y:g,d=(v=s*r+h*n+l)<d?v:d,p=(y=a*r+u*n+c)<p?y:p,f=v>f?v:f,g=y>g?y:g,this.minX=d,this.minY=p,this.maxX=f,this.maxY=g},Xt.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<i;a+=2){var h=t[a],u=t[a+1];r=h<r?h:r,n=u<n?u:n,o=h>o?h:o,s=u>s?u:s}this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Xt.prototype.addVertices=function(t,e,i,r){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,g=i;g<r;g+=2){var v=e[g],y=e[g+1],_=o*v+a*y+u,m=h*y+s*v+l;c=_<c?_:c,d=m<d?m:d,p=_>p?_:p,f=m>f?m:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Xt.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Xt.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=n&&r<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<s?i:s,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},Xt.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=n&&r<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<s?i:s,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}};var Gt=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new kt,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Xt,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),r=0;r<i.length;++r){var n=i[r];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},i._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new e),this.tempDisplayObjectParent},e.prototype.updateTransform=function(){this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++},e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&(this.calculateBounds(),this._lastBoundsID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new Lt),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new Lt),t=this._localBoundsRect);var r=this.getBounds(!1,t);return this.parent=i,this.transform=e,r},e.prototype.toGlobal=function(t,e,i){return void 0===i&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},e.prototype.render=function(t){},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,i,r,n,o,s,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=r||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},i.x.get=function(){return this.position.x},i.x.set=function(t){this.transform.position.x=t},i.y.get=function(){return this.position.y},i.y.set=function(t){this.transform.position.y=t},i.worldTransform.get=function(){return this.transform.worldTransform},i.localTransform.get=function(){return this.transform.localTransform},i.position.get=function(){return this.transform.position},i.position.set=function(t){this.transform.position.copyFrom(t)},i.scale.get=function(){return this.transform.scale},i.scale.set=function(t){this.transform.scale.copyFrom(t)},i.pivot.get=function(){return this.transform.pivot},i.pivot.set=function(t){this.transform.pivot.copyFrom(t)},i.skew.get=function(){return this.transform.skew},i.skew.set=function(t){this.transform.skew.copyFrom(t)},i.rotation.get=function(){return this.transform.rotation},i.rotation.set=function(t){this.transform.rotation=t},i.angle.get=function(){return this.transform.rotation*bt},i.angle.set=function(t){this.transform.rotation=t*wt},i.zIndex.get=function(){return this._zIndex},i.zIndex.set=function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},i.worldVisible.get=function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},i.mask.get=function(){return this._mask},i.mask.set=function(t){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)},Object.defineProperties(e.prototype,i),e}(f.a);function Yt(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}Gt.prototype.displayObjectUpdateTransform=Gt.prototype.updateTransform;var Vt=function(t){function e(){t.call(this),this.children=[],this.sortableChildren=d.SORTABLE_CHILDREN,this.sortDirty=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0}};return e.prototype.onChildrenChange=function(){},e.prototype.addChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r<i;r++)this.addChild(e[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this);return t},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i:r)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);J(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r<i;r++)this.removeChild(e[r]);else{var n=this.children.indexOf(t);if(-1===n)return null;t.parent=null,t.transform._parentID=-1,J(this.children,n,1),this._boundsID++,this.onChildrenChange(n),t.emit("removed",this),this.emit("childRemoved",t,this,n)}return t},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,J(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0);var i,r=t,n="number"==typeof e?e:this.children.length,o=n-r;if(o>0&&o<=n){i=this.children.splice(r,o);for(var s=0;s<i.length;++s)i[s].parent=null,i[s].transform&&(i[s].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var a=0;a<i.length;++a)i[a].emit("removed",this),this.emit("childRemoved",i[a],this,a);return i}if(0===o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,i=this.children.length;e<i;++e){var r=this.children[e];r._lastSortedIndex=e,t||0===r.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(Yt),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];e.visible&&e.renderable&&(e.calculateBounds(),e._mask?(e._mask.calculateBounds(),this._bounds.addBoundsMask(e._bounds,e._mask._bounds)):e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds))}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var r=0;r<e.length;r++)e[r].enabled&&this._enabledFilters.push(e[r]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}i&&t.mask.push(this,this._mask),this._render(t);for(var n=0,o=this.children.length;n<o;n++)this.children[n].render(t);t.batch.flush(),i&&t.mask.pop(this,this._mask),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i="boolean"==typeof e?e:e&&e.children,r=this.removeChildren(0,this.children.length);if(i)for(var n=0;n<r.length;++n)r[n].destroy(e)},i.width.get=function(){return this.scale.x*this.getLocalBounds().width},i.width.set=function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},i.height.get=function(){return this.scale.y*this.getLocalBounds().height},i.height.set=function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},Object.defineProperties(e.prototype,i),e}(Gt);Vt.prototype.containerUpdateTransform=Vt.prototype.updateTransform;
/*!
 * @pixi/accessibility - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/accessibility is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Wt={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1};Gt.mixin(Wt);var qt=function(t){this._hookDiv=null,(c.a.tablet||c.a.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2,this.div=e,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=t,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this.isActive=!1,this.isMobileAccessibility=!1,window.addEventListener("keydown",this._onKeyDown,!1)};qt.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2,e.style.backgroundColor="#FF0000",e.title="HOOK DIV",e.addEventListener("focus",function(){t.isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e},qt.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},qt.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},qt.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessibility&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},qt.prototype.updateAccessibleObjects=function(t){if(t.visible){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}},qt.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,i=t.height/this.renderer.height,r=this.div;r.style.left=t.left+"px",r.style.top=t.top+"px",r.style.width=this.renderer.width+"px",r.style.height=this.renderer.height+"px";for(var n=0;n<this.children.length;n++){var o=this.children[n];if(o.renderId!==this.renderId)o._accessibleActive=!1,J(this.children,n,1),this.div.removeChild(o._accessibleDiv),this.pool.push(o._accessibleDiv),o._accessibleDiv=null,n--,0===this.children.length&&this.deactivate();else{r=o._accessibleDiv;var s=o.hitArea,a=o.worldTransform;o.hitArea?(r.style.left=(a.tx+s.x*a.a)*e+"px",r.style.top=(a.ty+s.y*a.d)*i+"px",r.style.width=s.width*a.a*e+"px",r.style.height=s.height*a.d*i+"px"):(s=o.getBounds(),this.capHitArea(s),r.style.left=s.x*e+"px",r.style.top=s.y*i+"px",r.style.width=s.width*e+"px",r.style.height=s.height*i+"px",r.title!==o.accessibleTitle&&null!==o.accessibleTitle&&(r.title=o.accessibleTitle),r.getAttribute("aria-label")!==o.accessibleHint&&null!==o.accessibleHint&&r.setAttribute("aria-label",o.accessibleHint))}}this.renderId++}},qt.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},qt.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},qt.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData),e.dispatchEvent(t.target.displayObject,"pointertap",e.eventData),e.dispatchEvent(t.target.displayObject,"tap",e.eventData)},qt.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},qt.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},qt.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},qt.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},qt.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t<this.children.length;t++)this.children[t].div=null;window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null};
/*!
 * @pixi/runner - v5.1.1
 * Compiled Fri, 02 Aug 2019 23:20:23 UTC
 *
 * @pixi/runner is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Jt=function(t){this.items=[],this._name=t,this._aliasCount=0},Zt={empty:{configurable:!0},name:{configurable:!0}};Jt.prototype.emit=function(t,e,i,r,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this.name,u=this.items;this._aliasCount++;for(var l=0,c=u.length;l<c;l++)u[l][h](t,e,i,r,n,o,s,a);return u===this.items&&this._aliasCount--,this},Jt.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},Jt.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},Jt.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},Jt.prototype.contains=function(t){return-1!==this.items.indexOf(t)},Jt.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},Jt.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Zt.empty.get=function(){return 0===this.items.length},Zt.name.get=function(){return this._name},Object.defineProperties(Jt.prototype,Zt),Jt.prototype.dispatch=Jt.prototype.emit,Jt.prototype.run=Jt.prototype.emit,
/*!
 * @pixi/ticker - v5.1.1
 * Compiled Fri, 02 Aug 2019 23:20:23 UTC
 *
 * @pixi/ticker is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
d.TARGET_FPMS=.06;var Kt=50,Qt=25,$t=0,te=-25,ee=-50,ie=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=0),void 0===r&&(r=!1),this.fn=t,this.context=e,this.priority=i,this.once=r,this.next=null,this.previous=null,this._destroyed=!1};ie.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},ie.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},ie.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},ie.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e};var re=function(){var t=this;this._head=new ie(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/d.TARGET_FPMS,this.elapsedMS=1/d.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}},ne={FPS:{configurable:!0},minFPS:{configurable:!0},maxFPS:{configurable:!0}},oe={shared:{configurable:!0},system:{configurable:!0}};re.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},re.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},re.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},re.prototype.add=function(t,e,i){return void 0===i&&(i=$t),this._addListener(new ie(t,e,i))},re.prototype.addOnce=function(t,e,i){return void 0===i&&(i=$t),this._addListener(new ie(t,e,i,!0))},re.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},re.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},re.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},re.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},re.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},re.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*d.TARGET_FPMS;for(var r=this._head,n=r.next;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},ne.FPS.get=function(){return 1e3/this.elapsedMS},ne.minFPS.get=function(){return 1e3/this._maxElapsedMS},ne.minFPS.set=function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,d.TARGET_FPMS);this._maxElapsedMS=1/i},ne.maxFPS.get=function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},ne.maxFPS.set=function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},oe.shared.get=function(){if(!re._shared){var t=re._shared=new re;t.autoStart=!0,t._protected=!0}return re._shared},oe.system.get=function(){if(!re._system){var t=re._system=new re;t.autoStart=!0,t._protected=!0}return re._system},Object.defineProperties(re.prototype,ne),Object.defineProperties(re,oe);var se=function(){};se.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,te)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?re.shared:new re,t.autoStart&&this.start()},se.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};
/*!
 * @pixi/core - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/core is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var ae=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Jt("setRealSize",2),this.onUpdate=new Jt("update"),this.onError=new Jt("onError",1)},he={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};ae.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},ae.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},ae.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},he.valid.get=function(){return!!this._width&&!!this._height},ae.prototype.update=function(){this.destroyed||this.onUpdate.run()},ae.prototype.load=function(){return Promise.resolve()},he.width.get=function(){return this._width},he.height.get=function(){return this._height},ae.prototype.upload=function(t,e,i){return!1},ae.prototype.style=function(t,e,i){return!1},ae.prototype.dispose=function(){},ae.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},Object.defineProperties(ae.prototype,he);var ue=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=pt(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,o=e.realWidth,s=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&i.width===o&&i.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r):(i.width=o,i.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,r)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(ae),le=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:d.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==i.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():(i.onload=r,i.onerror=function(t){return e.onError.run(t)})}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,r){if(i.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in i._glTextures){var s=i._glTextures[o];if(s!==r&&s.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(ue),ce=[];function de(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ce.length-1;n>=0;--n){var o=ce[n];if(o.test&&o.test(t,i))return new o(t,e)}return new le(t,e)}var pe=function(t){function e(e,i){var r=i||{},n=r.width,o=r.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,i.internalFormat,e.width,e.height,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(ae),fe={scaleMode:A,format:T.RGBA,premultiplyAlpha:!1},ge=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).premultiplyAlpha,n=i.mipmap,o=i.anisotropicLevel,s=i.scaleMode,a=i.width,h=i.height,u=i.wrapMode,l=i.format,c=i.type,p=i.target,f=i.resolution,g=i.resourceOptions;!e||e instanceof ae||((e=de(e,g)).internal=!0),this.width=a||0,this.height=h||0,this.resolution=f||d.RESOLUTION,this.mipmap=void 0!==n?n:d.MIPMAP_TEXTURES,this.anisotropicLevel=void 0!==o?o:d.ANISOTROPIC_LEVEL,this.wrapMode=u||d.WRAP_MODE,this.scaleMode=void 0!==s?s:d.SCALE_MODE,this.format=l||T.RGBA,this.type=c||S.UNSIGNED_BYTE,this.target=p||E.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=K(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return Math.ceil(this.width*this.resolution-1e-4)},i.realHeight.get=function(){return Math.ceil(this.height*this.resolution-1e-4)},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=tt(this.realWidth)&&tt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete nt[this.cacheId],delete rt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,i){var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+K()),r=t._pixiId);var n=nt[r];return n||((n=new e(t,i)).cacheId=r,e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var o=new pe(t,{width:i,height:r}),s=t instanceof Float32Array?S.FLOAT:S.UNSIGNED_BYTE;return new e(o,Object.assign(fe,n||{width:i,height:r,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),nt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),nt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=nt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete nt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)delete nt[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},Object.defineProperties(e.prototype,i),e}(f.a);ge._globalBatch=0;var ve=function(t){function e(e,i){var r;i=i||{};var n=e;Array.isArray(e)&&(r=e,n=e.length),t.call(this,i.width,i.height),this.items=[],this.itemDirtyIds=[];for(var o=0;o<n;o++){var s=new ge;this.items.push(s),this.itemDirtyIds.push(-1)}if(this.length=n,this._load=null,r)for(var a=0;a<n;a++)this.addResourceAt(de(r[a],i),a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=E.TEXTURE_2D_ARRAY;for(var i=0;i<this.length;i++)this.items[i].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map(function(t){return t.resource}),i=e.map(function(t){return t.load()});return this._load=Promise.all(i).then(function(){var i=e[0],r=i.width,n=i.height;return t.resize(r,n),Promise.resolve(t)}),this._load},e.prototype.upload=function(t,e,i){var r=this.length,n=this.itemDirtyIds,o=this.items,s=t.gl;i.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,e.format,this._width,this._height,r,0,e.format,e.type,null);for(var a=0;a<r;a++){var h=o[a];n[a]<h.dirtyId&&(n[a]=h.dirtyId,h.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,a,h.resource.width,h.resource.height,1,e.format,e.type,h.resource.source))}return!0},e}(ae),ye=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.test=function(t){var e=window.OffscreenCanvas;return!!(e&&t instanceof e)||t instanceof HTMLCanvasElement},e}(ue),_e=function(t){function e(i,r){if(r=r||{},t.call(this,i,r),this.length!==e.SIDES)throw new Error("Invalid length. Got "+this.length+", expected 6");for(var n=0;n<e.SIDES;n++)this.items[n].target=E.TEXTURE_CUBE_MAP_POSITIVE_X+n;!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=E.TEXTURE_CUBE_MAP},e.prototype.upload=function(t,i,r){for(var n=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];n[o]<s.dirtyId&&(n[o]=s.dirtyId,s.valid&&s.resource.upload(t,s,r))}return!0},e}(ve);_e.SIDES=6;var me=function(t){function e(e,i){i=i||{},t.call(this,document.createElement("canvas")),this._width=0,this._height=0,this.svg=e,this.scale=i.scale||1,this._overrideWidth=i.width,this._overrideHeight=i.height,this._resolve=null,this._crossorigin=i.crossorigin,this._load=null,!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;return this._load?this._load:(this._load=new Promise(function(e){if(t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},/^\<svg/.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}),this._load)},e.prototype._loadSvg=function(){var e=this,i=new Image;t.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(t){i.onerror=null,e.onError.run(t)},i.onload=function(){var t=i.width,r=i.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=t*e.scale,o=r*e.scale;(e._overrideWidth||e._overrideHeight)&&(n=e._overrideWidth||e._overrideHeight/r*t,o=e._overrideHeight||e._overrideWidth/t*r),n=Math.round(n),o=Math.round(o);var s=e.source;s.width=n,s.height=o,s._pixiId="canvas_"+K(),s.getContext("2d").drawImage(i,0,0,t,r,0,0,n,o),e._resolve(),e._resolve=null}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),r={};return i&&(r[i[1]]=Math.round(parseFloat(i[3])),r[i[5]]=Math.round(parseFloat(i[7]))),r},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,e){return"svg"===e||"string"==typeof t&&0===t.indexOf("data:image/svg+xml;base64")||"string"==typeof t&&0===t.indexOf("<svg")},e}(ue);me.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var xe=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n<e.length;++n){var o=document.createElement("source"),s=e[n],a=s.src,h=s.mime,u=(a=a||e[n]).split("?").shift().toLowerCase(),l=u.substr(u.lastIndexOf(".")+1);h=h||"video/"+l,o.src=a,o.type=h,r.appendChild(o)}e=r}t.call(this,e),this._autoUpdate=!0,this._isAutoUpdating=!1,this._updateFPS=i.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==i.autoPlay,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),!1!==i.autoLoad&&this.load()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={autoUpdate:{configurable:!0},updateFPS:{configurable:!0}};return e.prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var i=re.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this,e),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(function(i){t.valid?i(t):(t._resolve=i,e.load())}),this._load},e.prototype._onError=function(){this.source.removeEventListener("error",this._onError,!0),this.onError.run(event)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(re.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(re.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&re.shared.remove(this.update,this),this.source&&(this.source.removeEventListener("error",this._onError,!0),this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(re.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(re.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(ue);xe.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"];var be=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.test=function(t){return!!window.createImageBitmap&&t instanceof ImageBitmap},e}(ue);ce.push(le,be,ye,xe,me,pe,_e,ve);var we={INSTALLED:ce,autoDetectResource:de,ArrayResource:ve,BufferResource:pe,CanvasResource:ye,CubeResource:_e,ImageResource:le,ImageBitmapResource:be,SVGResource:me,VideoResource:xe,Resource:ae,BaseImageResource:ue},Te=function(t){this.renderer=t};Te.prototype.destroy=function(){this.renderer=null};var Ee=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(pe),Se=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Jt("disposeFramebuffer",2)},Pe={colorTexture:{configurable:!0}};Pe.colorTexture.get=function(){return this.colorTextures[0]},Se.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new ge(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},Se.prototype.addDepthTexture=function(t){return this.depthTexture=t||new ge(new Ee(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:T.DEPTH_COMPONENT,type:S.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},Se.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},Se.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},Se.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var r=this.colorTextures[i],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){var o=this.depthTexture.resolution;this.depthTexture.setSize(t/o,e/o)}}},Se.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Object.defineProperties(Se.prototype,Pe);var Ae=function(t){function e(e){"number"==typeof e&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]});t.call(this,null,e);var i=e||{},r=i.width,n=i.height;this.mipmap=!1,this.width=Math.ceil(r)||100,this.height=Math.ceil(n)||100,this.valid=!0,this._canvasRenderTarget=null,this.clearColor=[0,0,0,0],this.framebuffer=new Se(this.width*this.resolution,this.height*this.resolution).addColorTexture(0,this).enableStencil(),this.stencilMaskStack=[],this.filterStack=[{}]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),this.framebuffer.resize(t*this.resolution,e*this.resolution)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this,!0),this.framebuffer=null},e}(ge),Ce=function(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)};Ce.prototype.set=function(t,e,i){var r=e.width,n=e.height;if(i){var o=t.width/2/r,s=t.height/2/n,a=t.x/r+o,h=t.y/n+s;i=Rt.add(i,Rt.NW),this.x0=a+o*Rt.uX(i),this.y0=h+s*Rt.uY(i),i=Rt.add(i,2),this.x1=a+o*Rt.uX(i),this.y1=h+s*Rt.uY(i),i=Rt.add(i,2),this.x2=a+o*Rt.uX(i),this.y2=h+s*Rt.uY(i),i=Rt.add(i,2),this.x3=a+o*Rt.uX(i),this.y3=h+s*Rt.uY(i)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3};var Oe=new Ce,Ie=function(t){function e(i,r,n,o,s,a){if(t.call(this),this.noFrame=!1,r||(this.noFrame=!0,r=new Lt(0,0,1,1)),i instanceof e&&(i=i.baseTexture),this.baseTexture=i,this._frame=r,this.trim=o,this.valid=!1,this.requiresUpdate=!1,this._uvs=Oe,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new yt(a.x,a.y):new yt(0,0),this._updateID=0,this.textureCacheIds=[],i.valid?this.noFrame?i.valid&&this.onBaseTextureUpdated(i):this.frame=r:i.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&i.on("update",this.onBaseTextureUpdated,this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={resolution:{configurable:!0},frame:{configurable:!0},rotate:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture.resource;i&&rt[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){return new e(this.baseTexture,this.frame,this.orig,this.trim,this.rotate,this.defaultAnchor)},e.prototype.updateUvs=function(){this._uvs===Oe&&(this._uvs=new Ce),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i){void 0===i&&(i={});var r=null;"string"==typeof t?r=t:(t._pixiId||(t._pixiId="pixiid_"+K()),r=t._pixiId);var n=rt[r];return n||(i.resolution||(i.resolution=ft(t)),(n=new e(new ge(t,i))).baseTexture.cacheId=r,ge.addToCache(n.baseTexture,r),e.addToCache(n,r)),n},e.fromBuffer=function(t,i,r,n){return new e(ge.fromBuffer(t,i,r,n))},e.fromLoader=function(t,i,r){var n=new le(t);n.url=i;var o=new e(new ge(n,{scaleMode:d.SCALE_MODE,resolution:ft(i)}));return r||(r=i),ge.addToCache(o.baseTexture,r),e.addToCache(o,r),r!==i&&(ge.addToCache(o.baseTexture,i),e.addToCache(o,i)),o},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),rt[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),rt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=rt[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete rt[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)rt[t.textureCacheIds[r]]===t&&delete rt[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},i.resolution.get=function(){return this.baseTexture.resolution},i.frame.get=function(){return this._frame},i.frame.set=function(t){this._frame=t,this.noFrame=!1;var e=t.x,i=t.y,r=t.width,n=t.height,o=e+r>this.baseTexture.width,s=i+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(f.a);function Me(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}Ie.EMPTY=new Ie(new ge),Me(Ie.EMPTY),Me(Ie.EMPTY.baseTexture),Ie.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new Ie(new ge(new ye(t)))}(),Me(Ie.WHITE),Me(Ie.WHITE.baseTexture);var De=function(t){function e(e,i){var r=null;if(!(e instanceof Ae)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),r=arguments[0],i=null,e=new Ae({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new Ae(t))},e}(Ie),Re=function(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0};Re.prototype.createTexture=function(t,e){var i=new Ae(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new De(i)},Re.prototype.getOptimalTexture=function(t,e,i){void 0===i&&(i=1);var r=Re.SCREEN_KEY;t*=i,e*=i,this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight||(r=(65535&(t=$(t)))<<16|65535&(e=$(e))),this.texturePool[r]||(this.texturePool[r]=[]);var n=this.texturePool[r].pop();return n||(n=this.createTexture(t,e)),n.filterPoolKey=r,n.setResolution(i),n},Re.prototype.getFilterTexture=function(t,e){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution);return i.filterFrame=t.filterFrame,i},Re.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},Re.prototype.returnFilterTexture=function(t){this.returnTexture(t)},Re.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var r=0;r<i.length;r++)i[r].destroy(!0)}this.texturePool={}},Re.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){var e=Re.SCREEN_KEY,i=this.texturePool[e];if(this.enableFullScreen=t.width>0&&t.height>0,i)for(var r=0;r<i.length;r++)i[r].destroy(!0);this.texturePool[e]=[],this._pixelsWidth=t.width,this._pixelsHeight=t.height}},Re.SCREEN_KEY="screen";var ke=function(t,e,i,r,n,o,s){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=o,this.instance=s};ke.prototype.destroy=function(){this.buffer=null},ke.from=function(t,e,i,r,n){return new ke(t,e,i,r,n)};var Fe=0,Le=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Fe++,this.disposeRunner=new Jt("disposeBuffer",2)};function Ne(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}Le.prototype.update=function(t){this.data=t||this.data,this._updateID++},Le.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Le.prototype.destroy=function(){this.dispose(),this.data=null},Le.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Le(t)};var Be={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ue={5126:4,5123:2,5121:1},je=0,He={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},ze=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=je++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Jt("disposeGeometry",2),this.refCount=0};ze.prototype.addAttribute=function(t,e,i,r,n,o,s,a){if(void 0===r&&(r=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new Le(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,i,r,n);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new ke(l,i,r,n,o,s,a),this.instanced=this.instanced||a,this},ze.prototype.getAttribute=function(t){return this.attributes[t]},ze.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},ze.prototype.addIndex=function(t){return t.data||(t instanceof Array&&(t=new Uint16Array(t)),t=new Le(t)),t.index=!0,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},ze.prototype.getIndex=function(){return this.indexBuffer},ze.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],i=[],r=new Le;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),i.push(n.size*Ue[n.type]/4),n.buffer=0}for(r.data=function(t,e){for(var i=0,r=0,n={},o=0;o<t.length;o++)r+=e[o],i+=t[o].length;for(var s=new ArrayBuffer(4*i),a=null,h=0,u=0;u<t.length;u++){var l=e[u],c=t[u],d=Ne(c);n[d]||(n[d]=new Be[d](s)),a=n[d];for(var p=0;p<c.length;p++)a[(p/l|0)*r+h+p%l]=c[p];h+=l}return new Float32Array(s)}(e,i),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},ze.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},ze.prototype.dispose=function(){this.disposeRunner.run(this,!1)},ze.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer.destroy(),this.attributes=null},ze.prototype.clone=function(){for(var t=new ze,e=0;e<this.buffers.length;e++)t.buffers[e]=new Le(this.buffers[e].data.slice());for(var i in this.attributes){var r=this.attributes[i];t.attributes[i]=new ke(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.index=!0),t},ze.merge=function(t){for(var e,i=new ze,r=[],n=[],o=[],s=0;s<t.length;s++){e=t[s];for(var a=0;a<e.buffers.length;a++)n[a]=n[a]||0,n[a]+=e.buffers[a].data.length,o[a]=0}for(var h=0;h<e.buffers.length;h++)r[h]=new(He[Ne(e.buffers[h].data)])(n[h]),i.buffers[h]=new Le(r[h]);for(var u=0;u<t.length;u++){e=t[u];for(var l=0;l<e.buffers.length;l++)r[l].set(e.buffers[l].data,o[l]),o[l]+=e.buffers[l].data.length}if(i.attributes=e.attributes,e.indexBuffer){i.indexBuffer=i.buffers[e.buffers.indexOf(e.indexBuffer)],i.indexBuffer.index=!0;for(var c=0,d=0,p=0,f=0,g=0;g<e.buffers.length;g++)if(e.buffers[g]!==e.indexBuffer){f=g;break}for(var v in e.attributes){var y=e.attributes[v];(0|y.buffer)===f&&(d+=y.size*Ue[y.type]/4)}for(var _=0;_<t.length;_++){for(var m=t[_].indexBuffer.data,x=0;x<m.length;x++)i.indexBuffer.data[x+p]+=c;c+=e.buffers[f].data.length/d,p+=m.length}}return i};var Xe=function(t){function e(){t.call(this),this.addAttribute("aVertexPosition",[0,0,1,0,1,1,0,1]).addIndex([0,1,3,2])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ze),Ge=function(t){function e(){t.call(this),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Le(this.vertices),this.uvBuffer=new Le(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,e){var i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(ze),Ye=0,Ve=function(t,e){this.uniforms=t,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Ye++,this.static=!!e};Ve.prototype.update=function(){this.dirtyId++},Ve.prototype.add=function(t,e,i){this.uniforms[t]=new Ve(e,i)},Ve.from=function(t,e){return new Ve(t,e)};var We=function(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new Lt,this.destinationFrame=new Lt,this.filters=[]};We.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null};var qe=function(t){function e(e){t.call(this,e),this.defaultFilterStack=[{}],this.texturePool=new Re,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new Xe,this.quadUv=new Ge,this.tempRect=new Lt,this.activeState={},this.globalUniforms=new Ve({outputFrame:this.tempRect,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this._pixelsWidth=e.view.width,this._pixelsHeight=e.view.height}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e){for(var i=this.renderer,r=this.defaultFilterStack,n=this.statePool.pop()||new We,o=e[0].resolution,s=e[0].padding,a=e[0].autoFit,h=e[0].legacy,u=1;u<e.length;u++){var l=e[u];o=Math.min(o,l.resolution),s=Math.max(s,l.padding),a=a||l.autoFit,h=h||l.legacy}1===r.length&&(this.defaultFilterStack[0].renderTexture=i.renderTexture.current),r.push(n),n.resolution=o,n.legacy=h,n.target=t,n.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),n.sourceFrame.pad(s),a&&n.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),n.sourceFrame.ceil(o),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,o),n.filters=e,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height,n.renderTexture.filterFrame=n.sourceFrame,i.renderTexture.bind(n.renderTexture,n.sourceFrame),i.renderTexture.clear()},e.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var r=this.globalUniforms.uniforms;r.outputFrame=e.sourceFrame,r.resolution=e.resolution;var n=r.inputSize,o=r.inputPixel,s=r.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=n[0]*e.resolution,o[1]=n[1]*e.resolution,o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=r.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(1===i.length)i[0].apply(this,e.renderTexture,h.renderTexture,!1,e),this.returnFilterTexture(e.renderTexture);else{var u=e.renderTexture,l=this.getOptimalFilterTexture(u.width,u.height,e.resolution);l.filterFrame=u.filterFrame;var c=0;for(c=0;c<i.length-1;++c){i[c].apply(this,u,l,!0,e);var d=u;u=l,l=d}i[c].apply(this,u,h.renderTexture,!1,e),this.returnFilterTexture(u),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},e.prototype.applyFilter=function(t,e,i,r){var n=this.renderer;n.renderTexture.bind(i,i?i.filterFrame:null),r&&n.renderTexture.clear(),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.state.set(t.state),n.shader.bind(t),t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(w.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(w.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,r=i.sourceFrame,n=i.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,r.x,r.y),a=e.worldTransform.copyTo(Et.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},e.prototype.destroy=function(){this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(t,e,i){return void 0===i&&(i=1),this.texturePool.getOptimalTexture(t,e,i)},e.prototype.getFilterTexture=function(t,e){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var r=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e}(Te),Je=function(t){this.renderer=t};Je.prototype.flush=function(){},Je.prototype.destroy=function(){this.renderer=null},Je.prototype.start=function(){},Je.prototype.stop=function(){this.flush()},Je.prototype.render=function(t){};var Ze=function(t){function e(e){t.call(this,e),this.emptyRenderer=new Je(e),this.currentRenderer=this.emptyRenderer}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e}(Te);d.PREFER_ENV=c.a.any?m.WEBGL:m.WEBGL2;var Ke=0,Qe=function(t){function e(e){t.call(this,e),this.webGLVersion=1,this.extensions={},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={isLost:{configurable:!0}};return i.isLost.get=function(){return!this.gl||this.gl.isContextLost()},e.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Ke++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},e.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Ke++,this.renderer.runners.contextChange.run(t)},e.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},e.prototype.createContext=function(t,e){var i;if(d.PREFER_ENV>=m.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,i),e}(Te),$e=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new Se(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Lt,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;d.PREFER_ENV===m.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n<t.colorTextures.length;n++)t.colorTextures[n].texturePart?this.renderer.texture.unbind(t.colorTextures[n].texture):this.renderer.texture.unbind(t.colorTextures[n]);t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,t.width,t.height)}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,i,r){var n=this.viewport;n.width===i&&n.height===r&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,r))},i.size.get=function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},e.prototype.clear=function(t,e,i,r){var n=this.gl;n.clearColor(t,e,i,r),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},e.prototype.initFramebuffer=function(t){var e={framebuffer:this.gl.createFramebuffer(),stencil:null,dirtyId:0,dirtyFormat:0,dirtySize:0};return t.glFramebuffers[this.CONTEXT_UID]=e,this.managedFramebuffers.push(t),t.disposeRunner.add(this),e},e.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));for(var r=t.colorTextures,n=0;n<r.length;n++)this.renderer.texture.bind(r[n],0);t.depthTexture&&this.renderer.texture.bind(t.depthTexture,0)},e.prototype.updateFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],r=t.colorTextures.length;e.drawBuffers||(r=Math.min(r,1));for(var n=[],o=0;o<r;o++){var s=t.colorTextures[o];s.texturePart?(this.renderer.texture.bind(s.texture,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,e.TEXTURE_CUBE_MAP_NEGATIVE_X+s.side,s.texture._glTextures[this.CONTEXT_UID].texture,0)):(this.renderer.texture.bind(s,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,e.TEXTURE_2D,s._glTextures[this.CONTEXT_UID].texture,0)),n.push(e.COLOR_ATTACHMENT0+o)}if((n.length>1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new Lt},Object.defineProperties(e.prototype,i),e}(Te),ti=function(t){this.buffer=t,this.updateID=-1,this.byteLength=-1,this.refCount=0},ei={5126:4,5123:2,5121:1},ii=function(t){function e(e){t.call(this,e),this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.boundBuffers={},this.managedGeometries={},this.managedBuffers={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,!t.createVertexArray){var i=this.renderer.context.extensions.vertexArrayObject;d.PREFER_ENV===m.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(t){return i.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return i.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){},t.bindVertexArray=function(){},t.deleteVertexArray=function(){})}if(!t.vertexAttribDivisor){var r=t.getExtension("ANGLE_instanced_arrays");r?(t.vertexAttribDivisor=function(t,e){return r.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,i,n,o){return r.drawElementsInstancedANGLE(t,e,i,n,o)},t.drawArraysInstanced=function(t,e,i,n){return r.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},e.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,r=t.glVertexArrayObjects[this.CONTEXT_UID];r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={});var n=r[e.program.id]||this.initGeometryVao(t,e.program);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?i.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()},e.prototype.reset=function(){this.unbind()},e.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.gl,i=0;i<t.buffers.length;i++){var r=t.buffers[i],n=r._glBuffers[this.CONTEXT_UID];if(r._updateID!==n.updateID){n.updateID=r._updateID;var o=r.index?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;if(e.bindBuffer(o,n.buffer),this._boundBuffer=n,n.byteLength>=r.data.byteLength)e.bufferSubData(o,0,r.data);else{var s=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(o,r.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var o in i)r[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*ei[h[d].type];for(var p in h){var f=h[p],g=f.size;void 0===f.stride&&(u[f.buffer]===g*ei[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=g*ei[f.type])}s=i.createVertexArray(),i.bindVertexArray(s);for(var v=0;v<a.length;v++){var y=a[v];y._glBuffers[r]||(y._glBuffers[r]=new ti(i.createBuffer()),this.managedBuffers[y.id]=y,y.disposeRunner.add(this)),y._glBuffers[r].refCount++}return this.activateVao(t,e),this._activeVao=s,o[e.id]=s,o[n]=s,s},e.prototype.disposeBuffer=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeGeometry=function(t,e){if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,n=t.buffers;if(t.disposeRunner.remove(this),i){for(var o=0;o<n.length;o++){var s=n[o]._glBuffers[this.CONTEXT_UID];s.refCount--,0!==s.refCount||e||this.disposeBuffer(n[o],e)}if(!e)for(var a in i)if("g"===a[0]){var h=i[a];this._activeVao===h&&this.unbind(),r.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t);e=Object.keys(this.managedBuffers);for(var r=0;r<e.length;r++)this.disposeBuffer(this.managedBuffers[e[r]],t)},e.prototype.activateVao=function(t,e){var i=this.gl,r=this.CONTEXT_UID,n=t.buffers,o=t.attributes;t.indexBuffer&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.indexBuffer._glBuffers[r].buffer);var s=null;for(var a in o){var h=o[a],u=n[h.buffer]._glBuffers[r];if(e.attributeData[a]){s!==u&&(i.bindBuffer(i.ARRAY_BUFFER,u.buffer),s=u);var l=e.attributeData[a].location;if(i.enableVertexAttribArray(l),i.vertexAttribPointer(l,h.size,h.type||i.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");i.vertexAttribDivisor(l,1)}}}},e.prototype.draw=function(t,e,i,r){var n=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(i||0)*s,r||1):n.drawElements(t,e||o.indexBuffer.data.length,a,(i||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?n.drawArraysInstanced(t,i,e||o.getSize(),r||1):n.drawArrays(t,i,e||o.getSize());return this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(Te);function ri(t,e,i,r){var n=ni(t,t.VERTEX_SHADER,e),o=ni(t,t.FRAGMENT_SHADER,i),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,o),r)for(var a in r)t.bindAttribLocation(s,r[a],a);return t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(s,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(s)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(s)),t.deleteProgram(s),s=null),t.deleteShader(n),t.deleteShader(o),s}function ni(t,e,i){var r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)?r:(console.warn(i),console.error(t.getShaderInfoLog(r)),null)}function oi(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return si(2*e);case"bvec3":return si(3*e);case"bvec4":return si(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}function si(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e}var ai,hi={},ui=hi;function li(){if(ui===hi){var t,e=document.createElement("canvas");d.PREFER_ENV>=m.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),ui=t}return ui}function ci(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===D.HIGH&&i!==D.HIGH&&(r=D.MEDIUM),"precision "+r+" float;\n"+t}return i!==D.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var di={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function pi(t){return di[t]}var fi=null,gi={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function vi(t,e){if(!fi){var i=Object.keys(gi);fi={};for(var r=0;r<i.length;++r){var n=i[r];fi[t[n]]=gi[n]}}return fi[e]}var yi={float:"\n    if(cv !== v)\n    {\n        cv.v = v;\n        gl.uniform1f(location, v)\n    }",vec2:"\n    if(cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"gl.uniform4f(location, v[0], v[1], v[2], v[3])",int:"gl.uniform1i(location, v)",ivec2:"gl.uniform2i(location, v[0], v[1])",ivec3:"gl.uniform3i(location, v[0], v[1], v[2])",ivec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",bool:"gl.uniform1i(location, v)",bvec2:"gl.uniform2i(location, v[0], v[1])",bvec3:"gl.uniform3i(location, v[0], v[1], v[2])",bvec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},_i={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var mi,xi=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function bi(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}var wi=0,Ti={},Ei=function t(e,i,r){void 0===r&&(r="pixi-shader"),this.id=wi++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(r=r.replace(/\s+/g,"-"),Ti[r]?(Ti[r]++,r+="-"+Ti[r]):Ti[r]=1,this.vertexSrc="#define SHADER_NAME "+r+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+r+"\n"+this.fragmentSrc,this.vertexSrc=ci(this.vertexSrc,d.PRECISION_VERTEX,D.HIGH),this.fragmentSrc=ci(this.fragmentSrc,d.PRECISION_FRAGMENT,function(){if(!ai){ai=D.MEDIUM;var t=li();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);ai=e.precision?D.HIGH:D.MEDIUM}}return ai}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null},Si={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};Ei.prototype.extractData=function(t,e){var i=li();if(i){var r=ri(i,t,e);this.attributeData=this.getAttributeData(r,i),this.uniformData=this.getUniformData(r,i),i.deleteProgram(r)}else this.uniformData={},this.attributeData={}},Ei.prototype.getAttributeData=function(t,e){for(var i={},r=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var s=e.getActiveAttrib(t,o),a=vi(e,s.type),h={type:a,name:s.name,size:pi(a),location:0};i[s.name]=h,r.push(h)}r.sort(function(t,e){return t.name>e.name?1:-1});for(var u=0;u<r.length;u++)r[u].location=u;return i},Ei.prototype.getUniformData=function(t,e){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<r;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]/,""),a=o.name.match(/\[.*?\]/,""),h=vi(e,o.type);i[s]={type:h,size:o.size,isArray:a,value:oi(h,o.size)}}return i},Si.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"},Si.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},Ei.from=function(t,e,i){var r=t+e,n=it[r];return n||(it[r]=n=new Ei(t,e,i)),n},Object.defineProperties(Ei,Si);var Pi=function(t,e){for(var i in this.program=t,this.uniformGroup=e?e instanceof Ve?e:new Ve(e):new Ve({}),t.uniformData)this.uniformGroup.uniforms[i]instanceof Array&&(this.uniformGroup.uniforms[i]=new Float32Array(this.uniformGroup.uniforms[i]))},Ai={uniforms:{configurable:!0}};Pi.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var r=e.uniforms[i];if(r.group&&this.checkUniformExists(t,r))return!0}return!1},Pi.prototype.destroy=function(){this.uniformGroup=null},Ai.uniforms.get=function(){return this.uniformGroup.uniforms},Pi.from=function(t,e,i){var r=Ei.from(t,e);return new Pi(r,i)},Object.defineProperties(Pi.prototype,Ai);var Ci=function(){this.data=0,this.blendMode=b.NORMAL,this.polygonOffset=0,this.blend=!0},Oi={blend:{configurable:!0},offsets:{configurable:!0},culling:{configurable:!0},depthTest:{configurable:!0},clockwiseFrontFace:{configurable:!0},blendMode:{configurable:!0},polygonOffset:{configurable:!0}};Oi.blend.get=function(){return!!(1&this.data)},Oi.blend.set=function(t){!!(1&this.data)!==t&&(this.data^=1)},Oi.offsets.get=function(){return!!(2&this.data)},Oi.offsets.set=function(t){!!(2&this.data)!==t&&(this.data^=2)},Oi.culling.get=function(){return!!(4&this.data)},Oi.culling.set=function(t){!!(4&this.data)!==t&&(this.data^=4)},Oi.depthTest.get=function(){return!!(8&this.data)},Oi.depthTest.set=function(t){!!(8&this.data)!==t&&(this.data^=8)},Oi.clockwiseFrontFace.get=function(){return!!(16&this.data)},Oi.clockwiseFrontFace.set=function(t){!!(16&this.data)!==t&&(this.data^=16)},Oi.blendMode.get=function(){return this._blendMode},Oi.blendMode.set=function(t){this.blend=t!==b.NONE,this._blendMode=t},Oi.polygonOffset.get=function(){return this._polygonOffset},Oi.polygonOffset.set=function(t){this.offsets=!!t,this._polygonOffset=t},Ci.for2d=function(){var t=new Ci;return t.depthTest=!1,t.blend=!0,t},Object.defineProperties(Ci.prototype,Oi);var Ii=function(t){function e(i,r,n){var o=Ei.from(i||e.defaultVertexSrc,r||e.defaultFragmentSrc);t.call(this,o,n),this.padding=0,this.resolution=d.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0,this.legacy=!!this.program.attributeData.aTextureCoord,this.state=new Ci}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blendMode:{configurable:!0}},r={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};return e.prototype.apply=function(t,e,i,r,n){t.applyFilter(this,e,i,r,n)},i.blendMode.get=function(){return this.state.blendMode},i.blendMode.set=function(t){this.state.blendMode=t},r.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"},r.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},Object.defineProperties(e.prototype,i),Object.defineProperties(e,r),e}(Pi);Ii.SOURCE_KEY_MAP={};var Mi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n",Di="varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n",Ri=new Et,ki=function(t,e){this._texture=t,this.mapCoord=new Et,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=-1,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1},Fi={texture:{configurable:!0}};Fi.texture.get=function(){return this._texture},Fi.texture.set=function(t){this._texture=t,this._updateID=-1},ki.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var i=this.mapCoord,r=0;r<t.length;r+=2){var n=t[r],o=t[r+1];e[r]=n*i.a+o*i.c+i.tx,e[r+1]=n*i.b+o*i.d+i.ty}return e},ki.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._updateID===e._updateID)return!1;this._updateID=e._updateID;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var r=e.orig,n=e.trim;n&&(Ri.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(Ri));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,h=this.clampOffset;return s[0]=(e._frame.x+a+h)/o.width,s[1]=(e._frame.y+a+h)/o.height,s[2]=(e._frame.x+e._frame.width-a+h)/o.width,s[3]=(e._frame.y+e._frame.height-a+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},Object.defineProperties(ki.prototype,Fi);var Li=function(t){function e(e){var i=new Et;t.call(this,Mi,Di),e.renderable=!1,this.maskSprite=e,this.maskMatrix=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t,e,i,r){var n=this.maskSprite,o=this.maskSprite.texture;o.valid&&(o.transform||(o.transform=new ki(o,0)),o.transform.update(),this.uniforms.npmAlpha=o.baseTexture.premultiplyAlpha?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.transform.uClampFrame,t.applyFilter(this,e,i,r))},e}(Ii),Ni=function(t){function e(e){t.call(this,e),this.scissor=!1,this.scissorData=null,this.scissorRenderTarget=null,this.enableScissor=!1,this.alphaMaskPool=[],this.alphaMaskIndex=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e){if(e.isSprite)this.pushSpriteMask(t,e);else if(this.enableScissor&&!this.scissor&&this.renderer._activeRenderTarget.root&&!this.renderer.stencil.stencilMaskStack.length&&e.isFastRect()){var i=e.worldTransform,r=Math.atan2(i.b,i.a);(r=Math.round(r*(180/Math.PI)))%90?this.pushStencilMask(e):this.pushScissorMask(t,e)}else this.pushStencilMask(e)},e.prototype.pop=function(t,e){e.isSprite?this.popSpriteMask(t,e):this.enableScissor&&!this.renderer.stencil.stencilMaskStack.length?this.popScissorMask(t,e):this.popStencilMask(t,e)},e.prototype.pushSpriteMask=function(t,e){var i=this.alphaMaskPool[this.alphaMaskIndex];i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Li(e)]),i[0].resolution=this.renderer.resolution,i[0].maskSprite=e;var r=t.filterArea;t.filterArea=e.getBounds(!0),this.renderer.filter.push(t,i),t.filterArea=r,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e.prototype.pushStencilMask=function(t){this.renderer.batch.flush(),this.renderer.stencil.pushStencil(t)},e.prototype.popStencilMask=function(){this.renderer.stencil.popStencil()},e.prototype.pushScissorMask=function(t,e){e.renderable=!0;var i=this.renderer._activeRenderTarget,r=e.getBounds();r.fit(i.size),e.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var n=this.renderer.resolution;this.renderer.gl.scissor(r.x*n,(i.root?i.size.height-r.y-r.height:r.y)*n,r.width*n,r.height*n),this.scissorRenderTarget=i,this.scissorData=e,this.scissor=!0},e.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var t=this.renderer.gl;t.disable(t.SCISSOR_TEST)},e}(Te),Bi=function(t){function e(e){t.call(this,e),this.stencilMaskStack=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.stencilMaskStack.length;this.stencilMaskStack=t,t.length!==i&&(0===t.length?e.disable(e.STENCIL_TEST):(e.enable(e.STENCIL_TEST),this._useCurrent()))},e.prototype.pushStencil=function(t){var e=this.renderer.gl,i=this.stencilMaskStack.length;0===i&&e.enable(e.STENCIL_TEST),this.stencilMaskStack.push(t),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.EQUAL,i,this._getBitwiseMask()),e.stencilOp(e.KEEP,e.KEEP,e.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},e.prototype.popStencil=function(){var t=this.renderer.gl,e=this.stencilMaskStack.pop();0===this.stencilMaskStack.length?(t.disable(t.STENCIL_TEST),t.clear(t.STENCIL_BUFFER_BIT),t.clearStencil(0)):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.stencilMaskStack.length,this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.stencilMaskStack.length)-1},e.prototype.destroy=function(){t.prototype.destroy.call(this,this),this.stencilMaskStack=null},e}(Te),Ui=function(t){function e(e){t.call(this,e),this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Et,this.transform=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,r),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(t,e,i,r){var n=this.projectionMatrix;r?(n.a=1/t.width*2*i,n.d=-1/t.height*2*i,n.tx=-1-e.x*n.a,n.ty=1-e.y*n.d):(n.a=1/t.width*2*i,n.d=1/t.height*2*i,n.tx=-1-e.x*n.a,n.ty=-1-e.y*n.d)},e.prototype.setTransform=function(){},e}(Te),ji=new Lt,Hi=function(t){function e(e){t.call(this,e),this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Lt,this.destinationFrame=new Lt}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(t,e,i){void 0===t&&(t=null),this.current=t;var r,n=this.renderer;if(t){var o=t.baseTexture;r=o.resolution,i||(ji.width=o.realWidth,ji.height=o.realHeight,i=ji),e||(e=i),this.renderer.framebuffer.bind(o.framebuffer,i),this.renderer.projection.update(i,e,r,!1),this.renderer.stencil.setMaskStack(o.stencilMaskStack)}else r=this.renderer.resolution,i||(ji.width=n.width,ji.height=n.height,i=ji),e||(e=i),n.framebuffer.bind(null,i),this.renderer.projection.update(i,e,r,!0),this.renderer.stencil.setMaskStack(this.defaultMaskStack);this.sourceFrame.copyFrom(e),this.destinationFrame.x=i.x/r,this.destinationFrame.y=i.y/r,this.destinationFrame.width=i.width/r,this.destinationFrame.height=i.height/r,e===i&&this.sourceFrame.copyFrom(this.destinationFrame)},e.prototype.clear=function(t){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor,this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3])},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e}(Te),zi=function(t,e){this.program=t,this.uniformData=e,this.uniformGroups={}};zi.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null};var Xi=0,Gi=function(t){function e(e){t.call(this,e),this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this.id=Xi++}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof mi)return mi;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");mi=!0===t({a:"b"},"a","b")}catch(t){mi=!1}return mi}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(t){this.gl=t,this.reset()},e.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||this.syncUniformGroup(t.uniformGroup),r},e.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},e.prototype.syncUniformGroup=function(t){var e=this.getglProgram();t.static&&t.dirtyId===e.uniformGroups[t.id]||(e.uniformGroups[t.id]=t.dirtyId,this.syncUniforms(t,e))},e.prototype.syncUniforms=function(t,e){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer)},e.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData);return this.cache[e]||(this.cache[e]=function(t,e){var i=0,r="var v = null;\n    var cv = null\n    var gl = renderer.gl";for(var n in t.uniforms){var o=e[n];o?"float"===o.type&&1===o.size?r+="\n            if(uv."+n+" !== ud."+n+".value)\n            {\n                ud."+n+".value = uv."+n+"\n                gl.uniform1f(ud."+n+".location, uv."+n+")\n            }\n":"sampler2D"!==o.type&&"samplerCube"!==o.type&&"sampler2DArray"!==o.type||1!==o.size||o.isArray?"mat3"===o.type&&1===o.size?void 0!==t.uniforms[n].a?r+="\n                gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+".toArray(true));\n                \n":r+="\n                gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+");\n                \n":"vec2"===o.type&&1===o.size?void 0!==t.uniforms[n].x?r+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud."+n+".location, v.x, v.y);\n                }\n":r+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud."+n+".location, v[0], v[1]);\n                }\n                \n":"vec4"===o.type&&1===o.size?void 0!==t.uniforms[n].width?r+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud."+n+".location, v.x, v.y, v.width, v.height)\n                }\n":r+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud."+n+".location, v[0], v[1], v[2], v[3])\n                }\n                \n":r+="\n            cv = ud."+n+".value;\n            v = uv."+n+";\n            "+(1===o.size?yi:_i)[o.type].replace("location","ud."+n+".location")+";\n":(r+="\n            renderer.texture.bind(uv."+n+", "+i+");\n\n            if(ud."+n+".value !== "+i+")\n            {\n                ud."+n+".value = "+i+";\n                gl.uniform1i(ud."+n+".location, "+i+");\n; // eslint-disable-line max-len\n            }\n",i++):t.uniforms[n].group&&(r+="\n                    renderer.shader.syncUniformGroup(uv."+n+");\n                ")}return new Function("ud","uv","renderer",r)}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},e.prototype.getSignature=function(t,e){var i=t.uniforms,r=[];for(var n in i)r.push(n),e[n]&&r.push(e[n].type);return r.join("-")},e.prototype.getglProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateShader=function(t){var e=this.gl,i=t.program,r={};for(var n in i.attributeData)r[n]=i.attributeData[n].location;var o=ri(e,i.vertexSrc,i.fragmentSrc,r),s={};for(var a in i.uniformData){var h=i.uniformData[a];s[a]={location:e.getUniformLocation(o,a),value:oi(h.type,h.size)}}var u=new zi(o,s);return i.glPrograms[this.renderer.CONTEXT_UID]=u,u},e.prototype.reset=function(){this.program=null,this.shader=null},e.prototype.destroy=function(){this.destroyed=!0},e}(Te);var Yi=0,Vi=1,Wi=2,qi=3,Ji=4,Zi=function(t){function e(e){t.call(this,e),this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=b.NONE,this._blendEq=!1,this.map=[],this.map[Yi]=this.setBlend,this.map[Vi]=this.setOffset,this.map[Wi]=this.setCullFace,this.map[qi]=this.setDepthTest,this.map[Ji]=this.setFrontFace,this.checks=[],this.defaultState=new Ci,this.defaultState.blend=!0,this.defaultState.depth=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[b.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.ADD]=[t.ONE,t.ONE],e[b.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.NONE]=[0,0],e[b.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[b.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[b.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[b.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[b.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[b.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[b.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[b.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[b.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[b.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},e.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(var r=0;r<this.checks.length;r++)this.checks[r](this,t)},e.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(var i=0;i<this.checks.length;i++)this.checks[i](this,t);this.stateId=t.data},e.prototype.setBlend=function(t){this.updateCheck(e.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},e.prototype.setOffset=function(t){this.updateCheck(e.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},e.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},e.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},e.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},e.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],i=this.gl;2===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},e.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},e.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(0),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},e.prototype.updateCheck=function(t,e){var i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):e||-1===i||this.checks.splice(i,1)},e.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},e.checkPolygonOffset=function(t,e){t.setPolygonOffset(e.polygonOffset,0)},e}(Te),Ki=function(t){function e(e){t.call(this,e),this.count=0,this.checkCount=0,this.maxIdle=d.GC_MAX_IDLE,this.checkCountMax=d.GC_MAX_CHECK_COUNT,this.mode=d.GC_MODE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postrender=function(){this.count++,this.mode!==M&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;r<e.length;r++){var n=e[r];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var o=0,s=0;s<e.length;s++)null!==e[s]&&(e[o++]=e[s]);e.length=o}},e.prototype.unload=function(t){var e=this.renderer.textureSystem;t._texture&&t._texture._glRenderTargets&&e.destroyTexture(t._texture);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},e}(Te),Qi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121},$i=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ge}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var r=new Qi(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Qi(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(var n=0;n<6;n++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(var o=0;o<this.boundTextures.length;o++)this.bind(null,o)},e.prototype.bind=function(t,e){void 0===e&&(e=0);var i=this.gl;if(t){if((t=t.baseTexture||t).valid){t.touched=this.renderer.textureGC.count;var r=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.boundTextures[e]!==t&&i.bindTexture(t.target,r.texture),r.dirtyId!==t.dirtyId&&this.updateTexture(t),this.boundTextures[e]=t}}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},e.prototype.reset=function(){this._unknownBoundTextures=!0,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},e.prototype.unbind=function(t){var e=this.gl,i=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<i.length;r++)i[r]===this.unknownTexture&&this.bind(null,r)}for(var n=0;n<i.length;n++)i[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[t.target].texture),i[n]=null)},e.prototype.initTexture=function(t){var e=new Qi(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(t,e){if(e.internalFormat=t.format,e.type=t.type,2===this.webGLVersion){var i=this.renderer.gl;t.type===i.FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA32F),t.type===S.HALF_FLOAT&&(e.type=i.HALF_FLOAT),e.type===i.HALF_FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA16F)}},e.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e));else{var r=t.realWidth,n=t.realHeight,o=i.gl;(e.width!==r||e.height!==n||e.dirtyId<0)&&(e.width=r,e.height=n,o.texImage2D(t.target,0,e.internalFormat,r,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},e.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.baseTexture||t)._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var r=this.managedTextures.indexOf(t);-1!==r&&J(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==I&&2===this.webGLVersion||t.isPowerOfTwo?(e.mipmap=t.mipmap>=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=C),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===P){var n=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(Te),tr=new Et,er=function(t){function e(e,i){t.call(this),(i=Object.assign({},d.RENDER_OPTIONS,i)).roundPixels&&(d.ROUND_PIXELS=i.roundPixels,vt("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=x.UNKNOWN,this.screen=new Lt(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||d.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Vt,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},i.width.get=function(){return this.view.width},i.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=De.create(0|r.width,0|r.height,e,i);return tr.tx=-r.x,tr.ty=-r.y,this.render(t,n,!1,tr,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=x.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=j(t),U(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(f.a),ir=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=x.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Jt("destroy"),contextChange:new Jt("contextChange",1),reset:new Jt("reset"),update:new Jt("update"),postrender:new Jt("postrender"),prerender:new Jt("prerender"),resize:new Jt("resize",2)},this.globalUniforms=new Ve({projectionMatrix:new Et},!0),this.addSystem(Ni,"mask").addSystem(Qe,"context").addSystem(Zi,"state").addSystem(Gi,"shader").addSystem($i,"texture").addSystem(ii,"geometry").addSystem($e,"framebuffer").addSystem(Bi,"stencil").addSystem(Ui,"projection").addSystem(Ki,"textureGC").addSystem(qe,"filter").addSystem(Hi,"renderTexture").addSystem(Ze,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,N(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(B())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){for(var i in this.runners.destroy.run(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(er);var rr="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n",nr=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},or=function(t){this.rawBinaryData=new ArrayBuffer(t),this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)},sr={int8View:{configurable:!0},uint8View:{configurable:!0},int16View:{configurable:!0},uint16View:{configurable:!0},int32View:{configurable:!0}};sr.int8View.get=function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},sr.uint8View.get=function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},sr.int16View.get=function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},sr.uint16View.get=function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},sr.int32View.get=function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},or.prototype.view=function(t){return this[t+"View"]},or.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},or.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},Object.defineProperties(or.prototype,sr);var ar=function(t){function e(e){t.call(this,e),this.shaderGenerator=null,this.geometryClass=null,this.vertexSize=null,this.state=Ci.for2d(),this.size=8e3,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._drawCalls=[];for(var i=0;i<this.size/4;i++)this._drawCalls[i]=new nr;this._aBuffers={},this._iBuffers={},this.MAX_TEXTURES=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.renderer.gl;d.PREFER_ENV===m.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),d.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var i=e.createShader(e.FRAGMENT_SHADER);;){var r=xi.replace(/%forloop%/gi,bi(t));if(e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedElements[this._bufferSize++]=t)},e.prototype.flush=function(){if(0!==this._vertexCount){var t,e,i=this.getAttributeBuffer(this._vertexCount),r=this.getIndexBuffer(this._indexCount),n=this.renderer.gl,o=this._bufferedElements,s=this._drawCalls,a=this.MAX_TEXTURES,h=this._packedGeometries,u=this.vertexSize,l=this.renderer.textureGC.count,c=0,p=0,f=0,g=s[0],v=0,y=-1;g.textureCount=0,g.start=0,g.blend=y;var _,m=++ge._globalBatch;for(_=0;_<this._bufferSize;++_){var x=o[_];o[_]=null,t=x._texture.baseTexture;var b=X[t.premultiplyAlpha?1:0][x.blendMode];y!==b&&(y=b,e=null,f=a,m++),e!==t&&(e=t,t._batchEnabled!==m&&(f===a&&(m++,f=0,g.size=p-g.start,(g=s[v++]).textureCount=0,g.blend=y,g.start=p),t.touched=l,t._batchEnabled=m,t._id=f,g.textures[g.textureCount++]=t,f++)),this.packInterleavedGeometry(x,i,r,c,p),c+=x.vertexData.length/2*u,p+=x.indices.length}ge._globalBatch=m,g.size=p-g.start,d.CAN_UPLOAD_SAME_BUFFER?(h[this._flushId]._buffer.update(i.rawBinaryData,0),h[this._flushId]._indexBuffer.update(r,0),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,h[this._flushId]=new this.geometryClass),h[this._flushId]._buffer.update(i.rawBinaryData,0),h[this._flushId]._indexBuffer.update(r,0),this.renderer.geometry.bind(h[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++);var w=this.renderer.texture,T=this.renderer.state;for(_=0;_<v;_++){for(var E=s[_],S=E.textureCount,P=0;P<S;P++)w.bind(E.textures[P],P),E.textures[P]=null;T.setBlendMode(E.blend),n.drawElements(E.type,E.size,n.UNSIGNED_SHORT,2*E.start)}this._bufferSize=0,this._vertexCount=0,this._indexCount=0}},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.shader.bind(this._shader),d.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._drawCalls=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=$(Math.ceil(t/8)),i=et(e),r=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._aBuffers[r];return n||(this._aBuffers[r]=n=new or(r*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=$(Math.ceil(t/12)),i=et(e),r=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._iBuffers[i];return n||(this._iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.packInterleavedGeometry=function(t,e,i,r,n){for(var o=e.uint32View,s=e.float32View,a=r/this.vertexSize,h=t.uvs,u=t.indices,l=t.vertexData,c=t._texture.baseTexture._id,d=Math.min(t.worldAlpha,1),p=d<1&&t._texture.baseTexture.premultiplyAlpha?V(t._tintRGB,d):t._tintRGB+(255*d<<24),f=0;f<l.length;f+=2)s[r++]=l[f],s[r++]=l[f+1],s[r++]=h[f],s[r++]=h[f+1],o[r++]=p,s[r++]=c;for(var g=0;g<u.length;g++)i[n++]=a+u[g]},e}(Je),hr=function(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')};hr.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=Ve.from({uSamplers:e},!0);var r=this.fragTemplate;r=(r=r.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Ei(this.vertexSrc,r)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new Et,default:this.defaultGroupCache[t]};return new Pi(this.programCache[t],n)},hr.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+i+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"};var ur=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Le(null,e,!1),this._indexBuffer=new Le(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,S.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,S.FLOAT).addAttribute("aColor",this._buffer,4,!0,S.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,S.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ze),lr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n",cr="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n",dr=function(){},pr={defaultVertexSrc:{configurable:!0},defaultFragmentTemplate:{configurable:!0}};dr.create=function(t){var e=Object.assign({vertex:lr,fragment:cr,geometryClass:ur,vertexSize:6},t),i=e.vertex,r=e.fragment,n=e.vertexSize,o=e.geometryClass;return function(t){function e(e){t.call(this,e),this.shaderGenerator=new hr(i,r),this.geometryClass=o,this.vertexSize=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ar)},pr.defaultVertexSrc.get=function(){return lr},pr.defaultFragmentTemplate.get=function(){return cr},Object.defineProperties(dr,pr);var fr=dr.create(),gr=new Lt,vr=function(t){this.renderer=t,t.extract=this};
/*!
 * @pixi/extract - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/extract is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */vr.prototype.image=function(t,e,i){var r=new Image;return r.src=this.base64(t,e,i),r},vr.prototype.base64=function(t,e,i){return this.canvas(t).toDataURL(e,i)},vr.prototype.canvas=function(t){var e,i,r,n=this.renderer,o=!1,s=!1;t&&(t instanceof De?r=t:(r=this.renderer.generateTexture(t),s=!0)),r?(e=r.baseTexture.resolution,i=r.frame,o=!1,n.renderTexture.bind(r)):(e=this.renderer.resolution,o=!0,(i=gr).width=this.renderer.width,i.height=this.renderer.height,n.renderTexture.bind(null));var a=Math.floor(i.width*e),h=Math.floor(i.height*e),u=new ht(a,h,1),l=new Uint8Array(4*a*h),c=n.gl;c.readPixels(i.x*e,i.y*e,a,h,c.RGBA,c.UNSIGNED_BYTE,l);var d=u.context.getImageData(0,0,a,h);return vr.arrayPostDivide(l,d.data),u.context.putImageData(d,0,0),o&&(u.context.scale(1,-1),u.context.drawImage(u.canvas,0,-h)),s&&r.destroy(!0),u.canvas},vr.prototype.pixels=function(t){var e,i,r,n=this.renderer,o=!1;t&&(t instanceof De?r=t:(r=this.renderer.generateTexture(t),o=!0)),r?(e=r.baseTexture.resolution,i=r.frame,n.renderTexture.bind(r)):(e=n.resolution,(i=gr).width=n.width,i.height=n.height,n.renderTexture.bind(null));var s=i.width*e,a=i.height*e,h=new Uint8Array(4*s*a),u=n.gl;return u.readPixels(i.x*e,i.y*e,s,a,u.RGBA,u.UNSIGNED_BYTE,h),o&&r.destroy(!0),vr.arrayPostDivide(h,h),h},vr.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},vr.arrayPostDivide=function(t,e){for(var i=0;i<t.length;i+=4){var r=e[i+3]=t[i+3];0!==r?(e[i]=Math.round(Math.min(255*t[i]/r,255)),e[i+1]=Math.round(Math.min(255*t[i+1]/r,255)),e[i+2]=Math.round(Math.min(255*t[i+2]/r,255))):(e[i]=t[i],e[i+1]=t[i+1],e[i+2]=t[i+2])}};
/*!
 * @pixi/interaction - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/interaction is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var yr=function(){this.global=new yt,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0},_r={pointerId:{configurable:!0}};_r.pointerId.get=function(){return this.identifier},yr.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},yr.prototype.copyEvent=function(t){t.isPrimary&&(this.isPrimary=!0),this.button=t.button,this.buttons=Number.isInteger(t.buttons)?t.buttons:t.which,this.width=t.width,this.height=t.height,this.tiltX=t.tiltX,this.tiltY=t.tiltY,this.pointerType=t.pointerType,this.pressure=t.pressure,this.rotationAngle=t.rotationAngle,this.twist=t.twist||0,this.tangentialPressure=t.tangentialPressure||0},yr.prototype.reset=function(){this.isPrimary=!1},Object.defineProperties(yr.prototype,_r);var mr=function(){this.stopped=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null};mr.prototype.stopPropagation=function(){this.stopped=!0},mr.prototype.reset=function(){this.stopped=!1,this.currentTarget=null,this.target=null};var xr=function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE},br={pointerId:{configurable:!0},flags:{configurable:!0},none:{configurable:!0},over:{configurable:!0},rightDown:{configurable:!0},leftDown:{configurable:!0}};xr.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},br.pointerId.get=function(){return this._pointerId},br.flags.get=function(){return this._flags},br.flags.set=function(t){this._flags=t},br.none.get=function(){return this._flags===this.constructor.FLAGS.NONE},br.over.get=function(){return 0!=(this._flags&this.constructor.FLAGS.OVER)},br.over.set=function(t){this._doSet(this.constructor.FLAGS.OVER,t)},br.rightDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.RIGHT_DOWN)},br.rightDown.set=function(t){this._doSet(this.constructor.FLAGS.RIGHT_DOWN,t)},br.leftDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.LEFT_DOWN)},br.leftDown.set=function(t){this._doSet(this.constructor.FLAGS.LEFT_DOWN,t)},Object.defineProperties(xr.prototype,br),xr.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4});var wr={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Gt.mixin(wr);var Tr=1,Er={target:null,data:{global:null}},Sr=function(t){function e(e,i){t.call(this),i=i||{},this.renderer=e,this.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,this.interactionFrequency=i.interactionFrequency||10,this.mouse=new yr,this.mouse.identifier=Tr,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[Tr]=this.mouse,this.interactionDataPool=[],this.eventData=new mr,this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.mouseOverRenderer=!1,this.supportsTouchEvents="ontouchstart"in window,this.supportsPointerEvents=!!window.PointerEvent,this.onPointerUp=this.onPointerUp.bind(this),this.processPointerUp=this.processPointerUp.bind(this),this.onPointerCancel=this.onPointerCancel.bind(this),this.processPointerCancel=this.processPointerCancel.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.processPointerDown=this.processPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.processPointerMove=this.processPointerMove.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.processPointerOverOut=this.processPointerOverOut.bind(this),this.onPointerOver=this.onPointerOver.bind(this),this.cursorStyles={default:"inherit",pointer:"pointer"},this.currentCursorMode=null,this.cursor=null,this._tempPoint=new yt,this.resolution=1,this.delayedEvents=[],this.setTargetElement(this.renderer.view,this.renderer.resolution)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hitTest=function(t,e){return Er.target=null,Er.data.global=t,e||(e=this.renderer._lastObjectRendered),this.processInteractive(Er,e,null,!0),Er.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},e.prototype.addEvents=function(){this.interactionDOMElement&&(re.system.add(this.update,this,Kt),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},e.prototype.removeEvents=function(){this.interactionDOMElement&&(re.system.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},e.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.interactionDOMElement))if(this.didMove)this.didMove=!1;else{for(var e in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(e)){var i=this.activeInteractionData[e];if(i.originalEvent&&"touch"!==i.pointerType){var r=this.configureInteractionEventForDOMEvent(this.eventData,i.originalEvent,i);this.processInteractive(r,this.renderer._lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){if(t=t||"default",this.currentCursorMode!==t){this.currentCursorMode=t;var e=this.cursorStyles[t];if(e)switch(typeof e){case"string":this.interactionDOMElement.style.cursor=e;break;case"function":e(t);break;case"object":Object.assign(this.interactionDOMElement.style,e)}else"string"!=typeof t||Object.prototype.hasOwnProperty.call(this.cursorStyles,t)||(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,i){i.stopped||(i.currentTarget=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},e.prototype.delayDispatchEvent=function(t,e,i){this.delayedEvents.push({displayObject:t,eventString:e,eventData:i})},e.prototype.mapPositionToPoint=function(t,e,i){var r;r=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=1/this.resolution;t.x=(e-r.left)*(this.interactionDOMElement.width/r.width)*n,t.y=(i-r.top)*(this.interactionDOMElement.height/r.height)*n},e.prototype.processInteractive=function(t,e,i,r,n,o){if(!e||!e.visible)return!1;var s=t.data.global,a=!1,h=n=e.interactive||n,u=!0;if(e.hitArea?(r&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,u=!1)),h=!1):e._mask&&r&&(e._mask.containsPoint&&e._mask.containsPoint(s)||(r=!1)),u&&e.interactiveChildren&&e.children)for(var l=e.children,c=l.length-1;c>=0;c--){var d=l[c],p=this.processInteractive(t,d,i,r,h,!0);if(p){if(!d.parent)continue;h=!1,p&&(t.target&&(r=!1),a=!0)}}n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),i&&i(t,e,!!a)));var f=this.delayedEvents;if(f.length&&!o){var g=f.length;this.delayedEvents=[];for(var v=0;v<g;v++){var y=f[v];this.dispatchEvent(y.displayObject,y.eventString,y.eventData)}}return a},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,r=0;r<i;r++){var n=e[r],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,i){var r=t.data,n=t.data.identifier;if(i)if(e.trackedPointers[n]||(e.trackedPointers[n]=new xr(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===r.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===r.pointerType||"pen"===r.pointerType){var o=2===r.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,i){for(var r=this.normalizeToPointerData(t),n=r.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=r[s],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.renderer._lastObjectRendered,i,e||!o),this.emit(e?"pointercancel":"pointerup"+o,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+o:"mouseup"+o,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,u),this.releaseInteractionDataForPointerId(a.pointerId,h))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var i=t.data,r=t.data.identifier;void 0!==e.trackedPointers[r]&&(delete e.trackedPointers[r],this.dispatchEvent(e,"pointercancel",t),"touch"===i.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,i){var r=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===r.pointerType,a="mouse"===r.pointerType||"pen"===r.pointerType,h=!1;if(a){var u=2===r.button,l=xr.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,d=void 0!==o&&o.flags&c;i?(this.dispatchEvent(e,u?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):d&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),o&&(u?o.rightDown=!1:o.leftDown=!1)}i?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!h||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this.didMove=!0,this.cursor=null);for(var i=e.length,r=0;r<i;r++){var n=e[r],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t,this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,i){var r=t.data,n="touch"===r.pointerType,o="mouse"===r.pointerType||"pen"===r.pointerType;o&&this.processPointerOverOut(t,e,i),this.moveWhenInside&&!i||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,this.processInteractive(r,this.renderer._lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",r),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",r):this.releaseInteractionDataForPointerId(i.identifier)}},e.prototype.processPointerOverOut=function(t,e,i){var r=t.data,n=t.data.identifier,o="mouse"===r.pointerType||"pen"===r.pointerType,s=e.trackedPointers[n];i&&!s&&(s=e.trackedPointers[n]=new xr(n)),void 0!==s&&(i&&this.mouseOverRenderer?(s.over||(s.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",r),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",r)},e.prototype.getInteractionDataForPointerId=function(t){var e,i=t.pointerId;return i===Tr||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[i]?e=this.activeInteractionData[i]:((e=this.interactionDataPool.pop()||new yr).identifier=i,this.activeInteractionData[i]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,i){return t.data=i,this.mapPositionToPoint(i.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=i.global.x,e.globalY=i.global.y),i.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,r=t.changedTouches.length;i<r;i++){var n=t.changedTouches[i];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof window.PointerEvent?e.push(t):(void 0===t.isPrimary&&(t.isPrimary=!0),void 0===t.width&&(t.width=1),void 0===t.height&&(t.height=1),void 0===t.tiltX&&(t.tiltX=0),void 0===t.tiltY&&(t.tiltY=0),void 0===t.pointerType&&(t.pointerType="mouse"),void 0===t.pointerId&&(t.pointerId=Tr),void 0===t.pressure&&(t.pressure=.5),void 0===t.twist&&(t.twist=0),void 0===t.tangentialPressure&&(t.tangentialPressure=0),t.isNormalized=!0,e.push(t));return e},e.prototype.destroy=function(){this.removeEvents(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this._tempPoint=null},e}(f.a),Pr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive)return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},Ar=function(){this.reset()};Ar.prototype.clone=function(){var t=new Ar;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},Ar.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=Ie.WHITE,this.matrix=null,this.visible=!1},Ar.prototype.destroy=function(){this.texture=null,this.matrix=null};var Cr=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};Cr.prototype.clone=function(){return new Cr(this.shape,this.fillStyle,this.lineStyle,this.matrix)},Cr.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var Or={build:function(t){var e,i,r=t.shape,n=t.points,o=r.x,s=r.y;if(n.length=0,t.type===Tt.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u<a;u++)n.push(o+Math.sin(-h*u)*e,s+Math.cos(-h*u)*i);n.push(n[0],n[1])}},triangulate:function(t,e){var i=t.points,r=e.points,n=e.indices,o=r.length/2,s=o;r.push(t.shape.x,t.shape.y);for(var a=0;a<i.length;a+=2)r.push(i[a],i[a+1]),n.push(o++,s,o)}};function Ir(t,e){t.lineStyle.native?function(t,e){var i=0,r=t.shape,n=t.points||r.points,o=r.type!==Tt.POLY||r.closeStroke;if(0===n.length)return;var s=e.points,a=e.indices,h=n.length/2,u=s.length/2,l=u;for(s.push(n[0],n[1]),i=1;i<h;i++)s.push(n[2*i],n[2*i+1]),a.push(l,l+1),l++;o&&a.push(l,u)}(t,e):function(t,e){var i=t.shape,r=t.points||i.points.slice(),n=e.closePointEps;if(0===r.length)return;var o=t.lineStyle,s=new yt(r[0],r[1]),a=new yt(r[r.length-2],r[r.length-1]),h=i.type!==Tt.POLY||i.closeStroke,u=Math.abs(s.x-a.x)<n&&Math.abs(s.y-a.y)<n;if(h){r=r.slice(),u&&(r.pop(),r.pop(),a.set(r[r.length-2],r[r.length-1]));var l=a.x+.5*(s.x-a.x),c=a.y+.5*(s.y-a.y);r.unshift(l,c),r.push(l,c)}var d=e.points,p=r.length/2,f=r.length,g=d.length/2,v=o.width/2,y=r[0],_=r[1],m=r[2],x=r[3],b=0,w=0,T=-(_-x),E=y-m,S=0,P=0,A=0,C=0,O=Math.sqrt(T*T+E*E);T/=O,E/=O,T*=v,E*=v;var I=o.alignment,M=2*(1-I),D=2*I;d.push(y-T*M,_-E*M),d.push(y+T*D,_+E*D);for(var R=1;R<p-1;++R){y=r[2*(R-1)],_=r[2*(R-1)+1],m=r[2*R],x=r[2*R+1],b=r[2*(R+1)],w=r[2*(R+1)+1],T=-(_-x),E=y-m,O=Math.sqrt(T*T+E*E),T/=O,E/=O,T*=v,E*=v,S=-(x-w),P=m-b,O=Math.sqrt(S*S+P*P),S/=O,P/=O;var k=-E+_-(-E+x),F=-T+m-(-T+y),L=(-T+y)*(-E+x)-(-T+m)*(-E+_),N=-(P*=v)+w-(-P+x),B=-(S*=v)+m-(-S+b),U=(-S+b)*(-P+x)-(-S+m)*(-P+w),j=k*B-N*F;if(Math.abs(j)<.1)j+=10.1,d.push(m-T*M,x-E*M),d.push(m+T*D,x+E*D);else{var H=(F*U-B*L)/j,z=(N*L-k*U)/j,X=(H-m)*(H-m)+(z-x)*(z-x);X>196*v*v?(A=T-S,C=E-P,O=Math.sqrt(A*A+C*C),A/=O,C/=O,A*=v,C*=v,d.push(m-A*M,x-C*M),d.push(m+A*D,x+C*D),d.push(m-A*D*M,x-C*M),f++):(d.push(m+(H-m)*M,x+(z-x)*M),d.push(m-(H-m)*D,x-(z-x)*D))}}y=r[2*(p-2)],_=r[2*(p-2)+1],m=r[2*(p-1)],x=r[2*(p-1)+1],T=-(_-x),E=y-m,O=Math.sqrt(T*T+E*E),T/=O,E/=O,T*=v,E*=v,d.push(m-T*M,x-E*M),d.push(m+T*D,x+E*D);for(var G=e.indices,Y=0;Y<f-2;++Y)G.push(g,g+1,g+2),g++}(t,e)}var Mr={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,r=t.holes,n=e.points,o=e.indices;if(i.length>=6){for(var s=[],a=0;a<r.length;a++){var h=r[a];s.push(i.length/2),i=i.concat(h.points)}var u=v()(i,s,2);if(!u)return;for(var l=n.length/2,c=0;c<u.length;c+=3)o.push(u[c]+l),o.push(u[c+1]+l),o.push(u[c+2]+l);for(var d=0;d<i.length;d++)n.push(i[d])}}},Dr={build:function(t){var e=t.shape,i=t.points,r=e.x,n=e.y,o=e.width,s=e.height,a=e.radius;i.length=0,kr(r,n+a,r,n,r+a,n,i),kr(r+o-a,n,r+o,n,r+o,n+a,i),kr(r+o,n+s-a,r+o,n+s,r+o-a,n+s,i),kr(r+a,n+s,r,n+s,r,n+s-a,i)},triangulate:function(t,e){for(var i=t.points,r=e.points,n=e.indices,o=r.length/2,s=v()(i,null,2),a=0,h=s.length;a<h;a+=3)n.push(s[a]+o),n.push(s[a+1]+o),n.push(s[a+2]+o);for(var u=0,l=i.length;u<l;u++)r.push(i[u],i[++u])}};function Rr(t,e,i){return t+(e-t)*i}function kr(t,e,i,r,n,o,s){void 0===s&&(s=[]);for(var a=s,h=0,u=0,l=0,c=0,d=0,p=0,f=0,g=0;f<=20;++f)h=Rr(t,i,g=f/20),u=Rr(e,r,g),l=Rr(i,n,g),c=Rr(r,o,g),d=Rr(h,l,g),p=Rr(u,c,g),a.push(d,p);return a}var Fr=[],Lr=[],Nr=new yt,Br={};Br[Tt.POLY]=Mr,Br[Tt.CIRC]=Or,Br[Tt.ELIP]=Or,Br[Tt.RECT]={build:function(t){var e=t.shape,i=e.x,r=e.y,n=e.width,o=e.height,s=t.points;s.length=0,s.push(i,r,i+n,r,i+n,r+o,i,r+o)},triangulate:function(t,e){var i=t.points,r=e.points,n=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},Br[Tt.RREC]=Dr;var Ur=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},jr=function(t){function e(){t.call(this),this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.dirty=0,this.batchDirty=-1,this.cacheDirty=-1,this.clearDirty=0,this.drawCalls=[],this.batches=[],this.shapeIndex=0,this._bounds=new Xt,this.boundsDirty=-1,this.boundsPadding=0,this.batchable=!1,this.indicesUint16=null,this.uvsFloat32=null,this.closePointEps=1e-4}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={bounds:{configurable:!0}};return i.bounds.get=function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].textures.length=0,Lr.push(this.drawCalls[t]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var i=this.batches[e];i.start=0,i.attribStart=0,i.style=null,Fr.push(i)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,r){var n=new Cr(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(!this.graphicsData.length)return null;var i=new Cr(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e);for(var i=0;i<this.graphicsData.length;++i)this.graphicsData[i].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var r=e[i];if(r.fillStyle.visible&&(r.shape&&(r.matrix?r.matrix.applyInverse(t,Nr):Nr.copyFrom(t),r.shape.contains(Nr.x,Nr.y)))){if(r.holes)for(var n=0;n<r.holes.length;n++){if(r.holes[n].shape.contains(Nr.x,Nr.y))return!1}return!0}}return!1},e.prototype.updateBatches=function(){if(this.dirty!==this.cacheDirty)if(0!==this.graphicsData.length){if(this.dirty!==this.cacheDirty)for(var t=0;t<this.graphicsData.length;t++){var e=this.graphicsData[t];if(e.fillStyle&&!e.fillStyle.texture.baseTexture.valid)return;if(e.lineStyle&&!e.lineStyle.texture.baseTexture.valid)return}this.cacheDirty=this.dirty;var i=this.uvs,r=null,n=null,o=0,s=!1;if(this.batches.length>0){var a=(r=this.batches[this.batches.length-1]).style;n=a.texture.baseTexture,o=a.color+a.alpha,s=!!a.native}for(var h=this.shapeIndex;h<this.graphicsData.length;h++){this.shapeIndex++;var u=this.graphicsData[h],l=Br[u.type],c=u.fillStyle,d=u.lineStyle;l.build(u),u.matrix&&this.transformPoints(u.points,u.matrix);for(var p=0;p<2;p++){var f=0===p?c:d;if(f.visible){var g=f.texture.baseTexture,v=this.indices.length,y=this.points.length/2;!r||n===g&&o===f.color+f.alpha&&s===!!f.native||(r.size=v-r.start,r.attribSize=y-r.attribStart,r.size>0&&(r=null)),r||(r=Fr.pop()||new Ur,this.batches.push(r),g.wrapMode=O,n=g,o=f.color+f.alpha,s=f.native,r.style=f,r.start=v,r.attribStart=y);var _=this.points.length/2;if(0===p)u.holes.length?(this.processHoles(u.holes),Mr.triangulate(u,this)):l.triangulate(u,this);else{Ir(u,this);for(var m=0;m<u.holes.length;m++)Ir(u.holes[m],this)}var x=this.points.length/2-_;this.addUvs(this.points,i,f.texture,_,x,f.matrix)}}}var b=this.indices.length,w=this.points.length/2;if(r)if(r.size=b-r.start,r.attribSize=w-r.attribStart,this.indicesUint16=new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var T=0;T<this.batches.length;T++)for(var E=this.batches[T],S=0;S<E.size;S++){var P=E.start+S;this.indicesUint16[P]=this.indicesUint16[P]-E.attribStart}}else this.buildDrawCalls();else this.batchable=!0}else this.batchable=!0},e.prototype.isBatchable=function(){for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++ge._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].textures.length=0,Lr.push(this.drawCalls[e]);this.drawCalls.length=0;var i=this.uvs,r=this.colors,n=this.textureIds,o=Lr.pop()||new nr;o.textureCount=0,o.start=0,o.size=0,o.type=w.TRIANGLES;var s=0,a=null,h=0,u=!1,l=w.TRIANGLES,c=0;this.drawCalls.push(o);for(var d=0;d<this.batches.length;d++){var p=this.batches[d],f=p.style,g=f.texture.baseTexture;u!==!!f.native&&(l=(u=f.native)?w.LINES:w.TRIANGLES,a=null,s=8,t++),a!==g&&(a=g,g._batchEnabled!==t&&(8===s&&(t++,s=0,o.size>0&&(o=Lr.pop()||new nr,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),g.touched=1,g._batchEnabled=t,g._id=s,g.wrapMode=10497,o.textures[o.textureCount++]=g,s++)),o.size+=p.size,c+=p.size,h=g._id,this.addColors(r,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}ge._globalBatch=t;for(var v=this.points,y=new ArrayBuffer(3*v.length*4),_=new Float32Array(y),m=new Uint32Array(y),x=0,b=0;b<v.length/2;b++)_[x++]=v[2*b],_[x++]=v[2*b+1],_[x++]=i[2*b],_[x++]=i[2*b+1],m[x++]=r[b],_[x++]=n[b];this._buffer.update(y),this._indexBuffer.update(this.indicesUint16)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];Br[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=1/0,e=-1/0,i=1/0,r=-1/0;if(this.graphicsData.length)for(var n=null,o=0,s=0,a=0,h=0,u=0;u<this.graphicsData.length;u++){var l=this.graphicsData[u],c=l.type,d=l.lineStyle?l.lineStyle.width:0;if(n=l.shape,c===Tt.RECT||c===Tt.RREC)o=n.x-d/2,s=n.y-d/2,t=o<t?o:t,e=o+(a=n.width+d)>e?o+a:e,i=s<i?s:i,r=s+(h=n.height+d)>r?s+h:r;else if(c===Tt.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)<t?o-a:t,e=o+a>e?o+a:e,i=s-(h=n.radius+d/2)<i?s-h:i,r=s+h>r?s+h:r;else if(c===Tt.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)<t?o-a:t,e=o+a>e?o+a:e,i=s-(h=n.height+d/2)<i?s-h:i,r=s+h>r?s+h:r;else for(var p=n.points,f=0,g=0,v=0,y=0,_=0,m=0,x=0,b=0,w=0;w+2<p.length;w+=2)o=p[w],s=p[w+1],f=p[w+2],g=p[w+3],v=Math.abs(f-o),y=Math.abs(g-s),h=d,(a=Math.sqrt(v*v+y*y))<1e-9||(t=(x=(f+o)/2)-(_=(h/a*y+v)/2)<t?x-_:t,e=x+_>e?x+_:e,i=(b=(g+s)/2)-(m=(h/a*v+y)/2)<i?b-m:i,r=b+m>r?b+m:r)}else t=0,e=0,i=0,r=0;var T=this.boundsPadding;this._bounds.minX=t-T,this._bounds.maxX=e+T,this._bounds.minY=i-T,this._bounds.maxY=r+T},e.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var r=t[2*i],n=t[2*i+1];t[2*i]=e.a*r+e.c*n+e.tx,t[2*i+1]=e.b*r+e.d*n+e.ty}},e.prototype.addColors=function(t,e,i,r){for(var n=V((e>>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,o){for(var s=0,a=e.length,h=i.frame;s<n;){var u=t[2*(r+s)],l=t[2*(r+s)+1];if(o){var c=o.a*u+o.c*l+o.tx;l=o.b*u+o.d*l+o.ty,u=c}s++,e.push(u/h.width,l/h.height)}var d=i.baseTexture;(h.width<d.width||h.height<d.height)&&this.adjustUvs(e,i,a,n)},e.prototype.adjustUvs=function(t,e,i,r){for(var n=e.baseTexture,o=i+2*r,s=e.frame,a=s.width/n.width,h=s.height/n.height,u=s.x/s.width,l=s.y/s.height,c=Math.floor(t[i]+1e-6),d=Math.floor(t[i+1]+1e-6),p=i+2;p<o;p+=2)c=Math.min(c,Math.floor(t[p]+1e-6)),d=Math.min(d,Math.floor(t[p+1]+1e-6));u-=c,l-=d;for(var f=i;f<o;f+=2)t[f]=(t[f]+u)*a,t[f+1]=(t[f+1]+l)*h},Object.defineProperties(e.prototype,i),e}(ur);jr.BATCHABLE_SIZE=100;var Hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.width=0,this.alignment=.5,this.native=!1},e}(Ar),zr=function(){};zr.curveLength=function(t,e,i,r,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,g=0,v=0,y=0,_=0,m=t,x=e,b=1;b<=10;++b)y=m-(g=(f=(p=(d=1-(u=b/10))*d)*d)*t+3*p*u*i+3*d*(l=u*u)*n+(c=l*u)*s),_=x-(v=f*e+3*p*u*r+3*d*l*o+c*a),m=g,x=v,h+=Math.sqrt(y*y+_*_);return h},zr.curveTo=function(t,e,i,r,n,o,s){var a=s[s.length-2],h=s[s.length-1];s.length-=2;var u=Pr._segmentsCount(zr.curveLength(a,h,t,e,i,r,n,o)),l=0,c=0,d=0,p=0,f=0;s.push(a,h);for(var g=1,v=0;g<=u;++g)d=(c=(l=1-(v=g/u))*l)*l,f=(p=v*v)*v,s.push(d*a+3*c*v*t+3*l*p*i+f*n,d*h+3*c*v*e+3*l*p*r+f*o)};var Xr=function(){};Xr.curveLength=function(t,e,i,r,n,o){var s=t-2*i+n,a=e-2*r+o,h=2*i-2*t,u=2*r-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),d=h*h+u*u,p=2*Math.sqrt(l+c+d),f=Math.sqrt(l),g=2*l*f,v=2*Math.sqrt(d),y=c/f;return(g*p+f*c*(p-v)+(4*d*l-c*c)*Math.log((2*f+y+p)/(y+v)))/(4*g)},Xr.curveTo=function(t,e,i,r,n){for(var o=n[n.length-2],s=n[n.length-1],a=Pr._segmentsCount(Xr.curveLength(o,s,t,e,i,r)),h=0,u=0,l=1;l<=a;++l){var c=l/a;h=o+(t-o)*c,u=s+(e-s)*c,n.push(h+(t+(i-t)*c-h)*c,u+(e+(r-e)*c-u)*c)}};var Gr=function(){};Gr.curveTo=function(t,e,i,r,n,o){var s=o[o.length-2],a=o[o.length-1]-e,h=s-t,u=r-e,l=i-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=a*a+h*h,p=u*u+l*l,f=a*u+h*l,g=n*Math.sqrt(d)/c,v=n*Math.sqrt(p)/c,y=g*f/d,_=v*f/p,m=g*l+v*h,x=g*u+v*a,b=h*(v+y),w=a*(v+y),T=l*(g+_),E=u*(g+_);return{cx:m+t,cy:x+e,radius:n,startAngle:Math.atan2(w-x,b-m),endAngle:Math.atan2(E-x,T-m),anticlockwise:h*u>l*a}},Gr.arc=function(t,e,i,r,n,o,s,a,h){for(var u=s-o,l=Pr._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/xt)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),g=l-1,v=g%1/g,y=0;y<=g;++y){var _=c+o+d*(y+v*y),m=Math.cos(_),x=-Math.sin(_);h.push((p*m+f*x)*n+i,(p*-x+f*m)*n+r)}};var Yr=function(t){function e(e,i,r,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*r,u=xt/h,l=[],c=0;c<h;c++){var d=c%2?o:n,p=c*u+a;l.push(e+d*Math.cos(p),i+d*Math.sin(p))}t.call(this,l)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ht),Vr=new Float32Array(3),Wr=null,qr=function(t){function e(e){void 0===e&&(e=null),t.call(this),this.geometry=e||new jr,this.geometry.refCount++,this.shader=null,this.state=Ci.for2d(),this._fillStyle=new Ar,this._lineStyle=new Hr,this._matrix=null,this._holeMode=!1,this.currentPath=null,this.batches=[],this.batchTint=-1,this.vertexData=null,this._transformID=-1,this.batchDirty=-1,this.pluginName="batch",this.tint=16777215,this.blendMode=b.NORMAL}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blendMode:{configurable:!0},tint:{configurable:!0},fill:{configurable:!0},line:{configurable:!0}};return e.prototype.clone=function(){return this.finishPoly(),new e(this.geometry)},i.blendMode.set=function(t){this.state.blendMode=t},i.blendMode.get=function(){return this.state.blendMode},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t},i.fill.get=function(){return this._fillStyle},i.line.get=function(){return this._lineStyle},e.prototype.lineStyle=function(t,e,i,r,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=.5),void 0===n&&(n=!1),this.lineTextureStyle(t,Ie.WHITE,e,i,null,r,n),this},e.prototype.lineTextureStyle=function(t,e,i,r,n,o,s){void 0===t&&(t=0),void 0===e&&(e=Ie.WHITE),void 0===i&&(i=16777215),void 0===r&&(r=1),void 0===n&&(n=null),void 0===o&&(o=.5),void 0===s&&(s=!1),this.currentPath&&this.startPoly();var a=t>0&&r>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:i,width:t,alpha:r,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Ht,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Ht,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Xr.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,o){return this._initCurve(),zr.curveTo(t,e,i,r,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var o=this.currentPath.points,s=Gr.curveTo(t,e,i,r,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,o){if(void 0===o&&(o=!1),r===n)return this;if(!o&&n<=r?n+=xt:o&&r<=n&&(r+=xt),0===n-r)return this;var s=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-s),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(s,a)}else this.moveTo(s,a),u=this.currentPath.points;return Gr.arc(s,a,t,e,i,r,n,o,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(Ie.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,i,r){void 0===t&&(t=Ie.WHITE),void 0===e&&(e=16777215),void 0===i&&(i=1),void 0===r&&(r=null),this.currentPath&&this.startPoly();var n=i>0;return n?(r&&(r=r.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:i,texture:t,matrix:r,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Lt(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new zt(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Ut(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new jt(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n<i.length;++n)i[n]=e[n]}var o=new Ht(i);return o.closeStroke=r,this.drawShape(o),this},e.prototype.drawShape=function(t){return this._holeMode?this.geometry.drawHole(t,this._matrix):this.geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.drawStar=function(t,e,i,r,n,o){return void 0===o&&(o=0),this.drawPolygon(new Yr(t,e,i,r,n,o))},e.prototype.clear=function(){return this.geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){return!1},e.prototype._render=function(t){this.finishPoly();var e=this.geometry;if(e.updateBatches(),e.batchable){if(this.batchDirty!==e.batchDirty){this.batches=[],this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.vertexData=new Float32Array(e.points);for(var i=this.blendMode,r=0;r<e.batches.length;r++){var n=e.batches[r],o=n.style.color,s=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(e.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:s,blendMode:i,indices:new Uint16Array(e.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:U(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[r]=h}}if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var u=0;u<this.batches.length;u++){var l=this.batches[u];l.worldAlpha=this.worldAlpha*l.alpha,t.plugins[this.pluginName].render(l)}}}else{if(t.batch.flush(),!this.shader){if(!Wr){for(var c=new Int32Array(16),d=0;d<16;d++)c[d]=d;var p={tint:new Float32Array([1,1,1,1]),translationMatrix:new Et,default:Ve.from({uSamplers:c},!0)},f=t.plugins.batch._shader.program;Wr=new Pi(f,p)}this.shader=Wr}var g=this.shader.uniforms;g.translationMatrix=this.transform.worldTransform;var v=this.tint,y=this.worldAlpha;g.tint[0]=(v>>16&255)/255*y,g.tint[1]=(v>>8&255)/255*y,g.tint[2]=(255&v)/255*y,g.tint[3]=y,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.set(this.state);for(var _=0;_<e.drawCalls.length;_++){for(var m=e.drawCalls[_],x=m.textureCount,b=0;b<x;b++)t.texture.bind(m.textures[b],b);t.geometry.draw(m.type,m.size,m.start)}}},e.prototype._calculateBounds=function(){this.finishPoly();var t=this.geometry.bounds;this._bounds.addFrame(this.transform,t.minX,t.minY,t.maxX,t.maxY)},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this.geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=U(this.tint,Vr),e=0;e<this.batches.length;e++){var i=this.batches[e],r=i._batchRGB,n=(t[0]*r[0]*255<<16)+(t[1]*r[1]*255<<8)+(0|t[2]*r[2]*255);i._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l<a.length;l+=2){var c=a[l],d=a[l+1];h[u++]=e*c+r*d+o,h[u++]=n*d+i*c+s}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this.geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},Object.defineProperties(e.prototype,i),e}(Vt);qr._TEMP_POINT=new yt;
/*!
 * @pixi/sprite - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/sprite is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Jr=new yt,Zr=new Uint16Array([0,1,2,0,2,3]),Kr=function(t){function e(e){t.call(this),this._anchor=new _t(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=b.NORMAL,this.shader=null,this._cachedTint=16777215,this.uvs=null,this.texture=e||Ie.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=Zr,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=d.ROUND_PIXELS}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this._width&&(this.scale.x=Q(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Q(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,d=0,p=0,f=0,g=0;if(u?(d=(p=u.x-c._x*l.width)+u.width,f=(g=u.y-c._y*l.height)+u.height):(d=(p=-c._x*l.width)+l.width,f=(g=-c._y*l.height)+l.height),h[0]=i*p+n*g+s,h[1]=o*g+r*p+a,h[2]=i*d+n*g+s,h[3]=o*g+r*d+a,h[4]=i*d+n*f+s,h[5]=o*f+r*d+a,h[6]=i*p+n*f+s,h[7]=o*f+r*p+a,this._roundPixels)for(var v=0;v<8;v++)h[v]=Math.round(h[v])}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-r._x*i.width,d=c+i.width,p=-r._y*i.height,f=p+i.height;e[0]=o*c+a*p+u,e[1]=h*p+s*c+l,e[2]=o*d+a*p+u,e[3]=h*p+s*d+l,e[4]=o*d+a*f+u,e[5]=h*f+s*d+l,e[6]=o*c+a*f+u,e[7]=h*f+s*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Lt),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Jr);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,n=0;return Jr.x>=r&&Jr.x<r+e&&(n=-i*this.anchor.y,Jr.y>=n&&Jr.y<n+i)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},e.from=function(t,i){return new e(t instanceof Ie?t:Ie.from(t,i))},i.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},i.roundPixels.get=function(){return this._roundPixels},i.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},i.width.set=function(t){var e=Q(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},i.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},i.height.set=function(t){var e=Q(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){this._anchor.copyFrom(t)},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture=t||Ie.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,i),e}(Vt),Qr=0,$r={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Qr,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},tn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],en=function(t){this.styleID=0,this.reset(),sn(this,t,t)},rn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function nn(t){return"number"==typeof t?j(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function on(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=nn(t[e]);return t}return nn(t)}function sn(t,e,i){for(var r in i)Array.isArray(e[r])?t[r]=e[r].slice():t[r]=e[r]}en.prototype.clone=function(){var t={};return sn(t,this,$r),new en(t)},en.prototype.reset=function(){sn(this,$r,$r)},rn.align.get=function(){return this._align},rn.align.set=function(t){this._align!==t&&(this._align=t,this.styleID++)},rn.breakWords.get=function(){return this._breakWords},rn.breakWords.set=function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},rn.dropShadow.get=function(){return this._dropShadow},rn.dropShadow.set=function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},rn.dropShadowAlpha.get=function(){return this._dropShadowAlpha},rn.dropShadowAlpha.set=function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},rn.dropShadowAngle.get=function(){return this._dropShadowAngle},rn.dropShadowAngle.set=function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},rn.dropShadowBlur.get=function(){return this._dropShadowBlur},rn.dropShadowBlur.set=function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},rn.dropShadowColor.get=function(){return this._dropShadowColor},rn.dropShadowColor.set=function(t){var e=on(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},rn.dropShadowDistance.get=function(){return this._dropShadowDistance},rn.dropShadowDistance.set=function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},rn.fill.get=function(){return this._fill},rn.fill.set=function(t){var e=on(t);this._fill!==e&&(this._fill=e,this.styleID++)},rn.fillGradientType.get=function(){return this._fillGradientType},rn.fillGradientType.set=function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},rn.fillGradientStops.get=function(){return this._fillGradientStops},rn.fillGradientStops.set=function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},rn.fontFamily.get=function(){return this._fontFamily},rn.fontFamily.set=function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},rn.fontSize.get=function(){return this._fontSize},rn.fontSize.set=function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},rn.fontStyle.get=function(){return this._fontStyle},rn.fontStyle.set=function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},rn.fontVariant.get=function(){return this._fontVariant},rn.fontVariant.set=function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},rn.fontWeight.get=function(){return this._fontWeight},rn.fontWeight.set=function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},rn.letterSpacing.get=function(){return this._letterSpacing},rn.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},rn.lineHeight.get=function(){return this._lineHeight},rn.lineHeight.set=function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},rn.leading.get=function(){return this._leading},rn.leading.set=function(t){this._leading!==t&&(this._leading=t,this.styleID++)},rn.lineJoin.get=function(){return this._lineJoin},rn.lineJoin.set=function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},rn.miterLimit.get=function(){return this._miterLimit},rn.miterLimit.set=function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},rn.padding.get=function(){return this._padding},rn.padding.set=function(t){this._padding!==t&&(this._padding=t,this.styleID++)},rn.stroke.get=function(){return this._stroke},rn.stroke.set=function(t){var e=on(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},rn.strokeThickness.get=function(){return this._strokeThickness},rn.strokeThickness.set=function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},rn.textBaseline.get=function(){return this._textBaseline},rn.textBaseline.set=function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},rn.trim.get=function(){return this._trim},rn.trim.set=function(t){this._trim!==t&&(this._trim=t,this.styleID++)},rn.whiteSpace.get=function(){return this._whiteSpace},rn.whiteSpace.set=function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},rn.wordWrap.get=function(){return this._wordWrap},rn.wordWrap.set=function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},rn.wordWrapWidth.get=function(){return this._wordWrapWidth},rn.wordWrapWidth.set=function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},en.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&tn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(en.prototype,rn);var an=function(t,e,i,r,n,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};an.measureText=function(t,e,i,r){void 0===r&&(r=an._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),o=an.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=r.getContext("2d");s.font=n;for(var a=(i?an.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;l<a.length;l++){var c=s.measureText(a[l]).width+(a[l].length-1)*e.letterSpacing;h[l]=c,u=Math.max(u,c)}var d=u+e.strokeThickness;e.dropShadow&&(d+=e.dropShadowDistance);var p=e.lineHeight||o.fontSize+e.strokeThickness,f=Math.max(p,o.fontSize+e.strokeThickness)+(a.length-1)*(p+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new an(t,e,d,f,a,h,p+e.leading,u,o)},an.wordWrap=function(t,e,i){void 0===i&&(i=an._canvas);for(var r=i.getContext("2d"),n=0,o="",s="",a={},h=e.letterSpacing,u=e.whiteSpace,l=an.collapseSpaces(u),c=an.collapseNewlines(u),d=!l,p=e.wordWrapWidth+h,f=an.tokenize(t),g=0;g<f.length;g++){var v=f[g];if(an.isNewline(v)){if(!c){s+=an.addLine(o),d=!l,o="",n=0;continue}v=" "}if(l){var y=an.isBreakingSpace(v),_=an.isBreakingSpace(o[o.length-1]);if(y&&_)continue}var m=an.getFromCache(v,h,a,r);if(m>p)if(""!==o&&(s+=an.addLine(o),o="",n=0),an.canBreakWords(v,e.breakWords))for(var x=v.split(""),b=0;b<x.length;b++){for(var w=x[b],T=1;x[b+T];){var E=x[b+T],S=w[w.length-1];if(an.canBreakChars(S,E,v,b,e.breakWords))break;w+=E,T++}b+=w.length-1;var P=an.getFromCache(w,h,a,r);P+n>p&&(s+=an.addLine(o),d=!1,o="",n=0),o+=w,n+=P}else{o.length>0&&(s+=an.addLine(o),o="",n=0);var A=g===f.length-1;s+=an.addLine(v,!A),d=!1,o="",n=0}else m+n>p&&(d=!1,s+=an.addLine(o),o="",n=0),(o.length>0||!an.isBreakingSpace(v)||d)&&(o+=v,n+=m)}return s+=an.addLine(o,!1)},an.addLine=function(t,e){return void 0===e&&(e=!0),t=an.trimRight(t),t=e?t+"\n":t},an.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},an.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},an.collapseNewlines=function(t){return"normal"===t},an.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!an.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},an.isNewline=function(t){return"string"==typeof t&&an._newlines.indexOf(t.charCodeAt(0))>=0},an.isBreakingSpace=function(t){return"string"==typeof t&&an._breakingSpaces.indexOf(t.charCodeAt(0))>=0},an.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;r<t.length;r++){var n=t[r];an.isBreakingSpace(n)||an.isNewline(n)?(""!==i&&(e.push(i),i=""),e.push(n)):i+=n}return""!==i&&e.push(i),e},an.canBreakWords=function(t,e){return e},an.canBreakChars=function(t,e,i,r,n){return!0},an.measureFont=function(t){if(an._fonts[t])return an._fonts[t];var e={},i=an._canvas,r=an._context;r.font=t;var n=an.METRICS_STRING+an.BASELINE_SYMBOL,o=Math.ceil(r.measureText(n).width),s=Math.ceil(r.measureText(an.BASELINE_SYMBOL).width),a=2*s;s=s*an.BASELINE_MULTIPLIER|0,i.width=o,i.height=a,r.fillStyle="#f00",r.fillRect(0,0,o,a),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(n,0,s);var h=r.getImageData(0,0,o,a).data,u=h.length,l=4*o,c=0,d=0,p=!1;for(c=0;c<s;++c){for(var f=0;f<l;f+=4)if(255!==h[d+f]){p=!0;break}if(p)break;d+=l}for(e.ascent=s-c,d=u-l,p=!1,c=a;c>s;--c){for(var g=0;g<l;g+=4)if(255!==h[d+g]){p=!0;break}if(p)break;d-=l}return e.descent=c-s,e.fontSize=e.ascent+e.descent,an._fonts[t]=e,e},an.clearMetrics=function(t){void 0===t&&(t=""),t?delete an._fonts[t]:an._fonts={}};var hn=function(){try{var t=new OffscreenCanvas(0,0);return t.getContext("2d")?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}}();hn.width=hn.height=10,an._canvas=hn,an._context=hn.getContext("2d"),an._fonts={},an.METRICS_STRING="|ÉqÅ",an.BASELINE_SYMBOL="M",an.BASELINE_MULTIPLIER=1.4,an._newlines=[10,13],an._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var un={texture:!0,children:!1,baseTexture:!0},ln=function(t){function e(e,i,r){(r=r||document.createElement("canvas")).width=3,r.height=3;var n=Ie.from(r);n.orig=new Lt,n.trim=new Lt,t.call(this,n),this.canvas=r,this.context=this.canvas.getContext("2d"),this._resolution=d.RESOLUTION,this._autoResolution=!0,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=i,this.localStyleID=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0},style:{configurable:!0},text:{configurable:!0},resolution:{configurable:!0}};return e.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var i,r,n=this.context,o=an.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=o.width,a=o.height,h=o.lines,u=o.lineHeight,l=o.lineWidths,c=o.maxLineWidth,d=o.fontProperties;this.canvas.width=Math.ceil((Math.max(1,s)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,a)+2*e.padding)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=e.strokeThickness,n.textBaseline=e.textBaseline,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit;for(var p=e.dropShadow?2:1,f=0;f<p;++f){var g=e.dropShadow&&0===f,v=g?2*a:0,y=v*this.resolution;if(g){n.fillStyle="black",n.strokeStyle="black";var _=e.dropShadowColor,m=U("number"==typeof _?_:H(_));n.shadowColor="rgba("+255*m[0]+","+255*m[1]+","+255*m[2]+","+e.dropShadowAlpha+")",n.shadowBlur=e.dropShadowBlur,n.shadowOffsetX=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,n.shadowOffsetY=Math.sin(e.dropShadowAngle)*e.dropShadowDistance+y}else n.fillStyle=this._generateFillStyle(e,h),n.strokeStyle=e.stroke,n.shadowColor=0,n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;for(var x=0;x<h.length;x++)i=e.strokeThickness/2,r=e.strokeThickness/2+x*u+d.ascent,"right"===e.align?i+=c-l[x]:"center"===e.align&&(i+=(c-l[x])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[x],i+e.padding,r+e.padding-v,!0),e.fill&&this.drawLetterSpacing(h[x],i+e.padding,r+e.padding-v)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,i,r){void 0===r&&(r=!1);var n=this._style.letterSpacing;if(0!==n)for(var o=e,s=Array.from?Array.from(t):t.split(""),a=0;a<s.length;++a){var h=s[a];r?this.context.strokeText(h,o,i):this.context.fillText(h,o,i),o+=this.context.measureText(h).width+n}else r?this.context.strokeText(t,e,i):this.context.fillText(t,e,i)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=at(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var i=this._texture,r=this._style,n=r.trim?0:r.padding,o=i.baseTexture;i.trim.width=i._frame.width=Math.ceil(t.width/this._resolution),i.trim.height=i._frame.height=Math.ceil(t.height/this._resolution),i.trim.x=-n,i.trim.y=-n,i.orig.width=i._frame.width-2*n,i.orig.height=i._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._onStyleChange=function(){this.dirty=!0},e.prototype._generateFillStyle=function(t,e){if(!Array.isArray(t.fill))return t.fill;if(1===t.fill.length)return t.fill[0];var i,r,n,o,s=Math.ceil(this.canvas.width/this._resolution),a=Math.ceil(this.canvas.height/this._resolution),h=t.fill.slice(),u=t.fillGradientStops.slice();if(!u.length)for(var l=h.length+1,c=1;c<l;++c)u.push(c/l);if(h.unshift(t.fill[0]),u.unshift(0),h.push(t.fill[t.fill.length-1]),u.push(1),t.fillGradientType===Qr){i=this.context.createLinearGradient(s/2,0,s/2,a),r=(h.length+1)*e.length,n=0;for(var d=0;d<e.length;d++){n+=1;for(var p=0;p<h.length;p++)o="number"==typeof u[p]?u[p]/e.length+d/e.length:n/r,i.addColorStop(o,h[p]),n++}}else{i=this.context.createLinearGradient(0,a/2,s,a/2),r=h.length+1,n=1;for(var f=0;f<h.length;f++)o="number"==typeof u[f]?u[f]:n/r,i.addColorStop(o,h[f]),n++}return i},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},un,e),t.prototype.destroy.call(this,e),this.context=null,this.canvas=null,this._style=null},i.width.get=function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},i.width.set=function(t){this.updateText(!0);var e=Q(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},i.height.get=function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},i.height.set=function(t){this.updateText(!0);var e=Q(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},i.style.get=function(){return this._style},i.style.set=function(t){t=t||{},this._style=t instanceof en?t:new en(t),this.localStyleID=-1,this.dirty=!0},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.resolution.get=function(){return this._resolution},i.resolution.set=function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},Object.defineProperties(e.prototype,i),e}(Kr);
/*!
 * @pixi/prepare - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/prepare is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
d.UPLOADS_PER_FRAME=4;var cn=function(t){this.maxItemsPerFrame=t,this.itemsLeft=0};cn.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},cn.prototype.allowedToUpload=function(){return this.itemsLeft-- >0};var dn=function(t){var e=this;this.limiter=new cn(d.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(_n),this.registerFindHook(mn),this.registerFindHook(pn),this.registerFindHook(fn),this.registerFindHook(gn),this.registerUploadHook(vn),this.registerUploadHook(yn)};function pn(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r<t._textures.length;r++)if(t._textures[r]instanceof Ie){var n=t._textures[r].baseTexture;-1===e.indexOf(n)&&(e.push(n),i=!0)}return i}function fn(t,e){return t instanceof ge&&(-1===e.indexOf(t)&&e.push(t),!0)}function gn(t,e){if(t._texture&&t._texture instanceof Ie){var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function vn(t,e){return e instanceof ln&&(e.updateText(!0),!0)}function yn(t,e){if(e instanceof en){var i=e.toFontString();return an.measureFont(i),!0}return!1}function _n(t,e){if(t instanceof ln){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function mn(t,e){return t instanceof en&&(-1===e.indexOf(t)&&e.push(t),!0)}dn.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,re.system.addOnce(this.tick,this,ee))):e&&e()},dn.prototype.tick=function(){setTimeout(this.delayedTick,0)},dn.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var i=0,r=this.uploadHooks.length;i<r;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)re.system.addOnce(this.tick,this,ee);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(var o=0,s=n.length;o<s;o++)n[o]()}},dn.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},dn.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},dn.prototype.add=function(t){for(var e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Vt)for(var r=t.children.length-1;r>=0;r--)this.add(t.children[r]);return this},dn.prototype.destroy=function(){this.ticking&&re.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var xn=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(Tn),this.registerUploadHook(bn),this.registerUploadHook(wn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(dn);function bn(t,e){return e instanceof ge&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function wn(t,e){return e instanceof qr&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function Tn(t,e){return t instanceof qr&&(e.push(t),!0)}var En=function(t){this.maxMilliseconds=t,this.frameStart=0};En.prototype.beginFrame=function(){this.frameStart=Date.now()},En.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds};
/*!
 * @pixi/app - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/app is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Sn=function t(e){var i=this;e=Object.assign({forceCanvas:!1},e),this.renderer=function(t){return ir.create(t)}(e),this.stage=new Vt,t._plugins.forEach(function(t){t.init.call(i,e)})},Pn={view:{configurable:!0},screen:{configurable:!0}};Sn.registerPlugin=function(t){Sn._plugins.push(t)},Sn.prototype.render=function(){this.renderer.render(this.stage)},Pn.view.get=function(){return this.renderer.view},Pn.screen.get=function(){return this.renderer.screen},Sn.prototype.destroy=function(t,e){var i=this,r=Sn._plugins.slice(0);r.reverse(),r.forEach(function(t){t.destroy.call(i)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null,this._options=null},Object.defineProperties(Sn.prototype,Pn),Sn._plugins=[];var An=function(){};An.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){window.removeEventListener("resize",this.resize),this._resizeTo=t,t&&(window.addEventListener("resize",this.resize),this.resize())},get:function(){return this._resizeTo}}),this.resize=function(){e._resizeTo&&(e._resizeTo===window?e.renderer.resize(window.innerWidth,window.innerHeight):e.renderer.resize(e._resizeTo.clientWidth,e._resizeTo.clientHeight))},this._resizeTo=null,this.resizeTo=t.resizeTo||null},An.destroy=function(){this.resizeTo=null,this.resize=null},Sn.registerPlugin(An);var Cn=i(5),On=i.n(Cn),In=i(0),Mn=i.n(In);
/*!
 * resource-loader - v3.0.1
 * https://github.com/pixijs/pixi-sound
 * Compiled Tue, 02 Jul 2019 14:06:18 UTC
 *
 * resource-loader is licensed under the MIT license.
 * http://www.opensource.org/licenses/mit-license
 */
function Dn(){}function Rn(t,e,i,r){var n=0,o=t.length;!function s(a){a||n===o?i&&i(a):r?setTimeout(function(){e(t[n++],s)},1):e(t[n++],s)}()}function kn(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function Fn(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var i=0,r={_tasks:[],concurrency:e,saturated:Dn,unsaturated:Dn,buffer:e/4,empty:Dn,drain:Dn,error:Dn,started:!1,paused:!1,push:function(t,e){n(t,!1,e)},kill:function(){i=0,r.drain=Dn,r.started=!1,r._tasks=[]},unshift:function(t,e){n(t,!0,e)},process:function(){for(;!r.paused&&i<r.concurrency&&r._tasks.length;){var e=r._tasks.shift();0===r._tasks.length&&r.empty(),(i+=1)===r.concurrency&&r.saturated(),t(e.data,kn(o(e)))}},length:function(){return r._tasks.length},running:function(){return i},idle:function(){return r._tasks.length+i===0},pause:function(){!0!==r.paused&&(r.paused=!0)},resume:function(){if(!1!==r.paused){r.paused=!1;for(var t=1;t<=r.concurrency;t++)r.process()}}};function n(t,e,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout(function(){return r.drain()},1);else{var n={data:t,callback:"function"==typeof i?i:Dn};e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(function(){return r.process()},1)}}function o(t){return function(){i-=1,t.callback.apply(t,arguments),null!=arguments[0]&&r.error(arguments[0],t.data),i<=r.concurrency-r.buffer&&r.unsaturated(),r.idle()&&r.drain(),r.process()}}return r}var Ln={};function Nn(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bn(t,e,i){return e&&Nn(t.prototype,e),i&&Nn(t,i),t}var Un=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),jn=null;function Hn(){}var zn=function(){function t(e,i,r){if("string"!=typeof e||"string"!=typeof i)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===i.indexOf("data:")),this.name=e,this.url=i,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=Hn,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new Mn.a,this.onProgress=new Mn.a,this.onComplete=new Mn.a,this.onAfterMiddleware=new Mn.a}t.setExtensionLoadType=function(e,i){Xn(t._loadTypeMap,e,i)},t.setExtensionXhrType=function(e,i){Xn(t._xhrTypeMap,e,i)};var e=t.prototype;return e.complete=function(){this._clearEvents(),this._finish()},e.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},e.load=function(e){var i=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(i)},1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:Un&&this.crossOrigin?this._loadXdr():this._loadXhr()}},e._hasFlag=function(t){return 0!=(this._flags&t)},e._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},e._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},e._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},e._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},e._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else{var r=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(r)?r[0]:r))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},e._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},e._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},e._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var r=document.createElement("source");return r.src=e,r.type=i,r},e._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},e._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},e._onTimeout=function(){this.abort("Load timed out.")},e._xhrOnError=function(){var t=this.xhr;this.abort(Gn(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},e._xhrOnTimeout=function(){var t=this.xhr;this.abort(Gn(t)+" Request timed out.")},e._xhrOnAbort=function(){var t=this.xhr;this.abort(Gn(t)+" Request was aborted by the user.")},e._xhrOnLoad=function(){var e=this.xhr,i="",r=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(i=e.responseText),0===r&&(i.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},e._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,jn||(jn=document.createElement("a")),jn.href=t;var i=!(t=On()(jn.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,r=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&r===e.protocol?"":"anonymous"},e._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},e._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},e._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},e._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},Bn(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function Xn(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function Gn(t){return t.toString().replace("object ","")}zn.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},zn.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},zn.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},zn.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},zn._loadTypeMap={gif:zn.LOAD_TYPE.IMAGE,png:zn.LOAD_TYPE.IMAGE,bmp:zn.LOAD_TYPE.IMAGE,jpg:zn.LOAD_TYPE.IMAGE,jpeg:zn.LOAD_TYPE.IMAGE,tif:zn.LOAD_TYPE.IMAGE,tiff:zn.LOAD_TYPE.IMAGE,webp:zn.LOAD_TYPE.IMAGE,tga:zn.LOAD_TYPE.IMAGE,svg:zn.LOAD_TYPE.IMAGE,"svg+xml":zn.LOAD_TYPE.IMAGE,mp3:zn.LOAD_TYPE.AUDIO,ogg:zn.LOAD_TYPE.AUDIO,wav:zn.LOAD_TYPE.AUDIO,mp4:zn.LOAD_TYPE.VIDEO,webm:zn.LOAD_TYPE.VIDEO},zn._xhrTypeMap={xhtml:zn.XHR_RESPONSE_TYPE.DOCUMENT,html:zn.XHR_RESPONSE_TYPE.DOCUMENT,htm:zn.XHR_RESPONSE_TYPE.DOCUMENT,xml:zn.XHR_RESPONSE_TYPE.DOCUMENT,tmx:zn.XHR_RESPONSE_TYPE.DOCUMENT,svg:zn.XHR_RESPONSE_TYPE.DOCUMENT,tsx:zn.XHR_RESPONSE_TYPE.DOCUMENT,gif:zn.XHR_RESPONSE_TYPE.BLOB,png:zn.XHR_RESPONSE_TYPE.BLOB,bmp:zn.XHR_RESPONSE_TYPE.BLOB,jpg:zn.XHR_RESPONSE_TYPE.BLOB,jpeg:zn.XHR_RESPONSE_TYPE.BLOB,tif:zn.XHR_RESPONSE_TYPE.BLOB,tiff:zn.XHR_RESPONSE_TYPE.BLOB,webp:zn.XHR_RESPONSE_TYPE.BLOB,tga:zn.XHR_RESPONSE_TYPE.BLOB,json:zn.XHR_RESPONSE_TYPE.JSON,text:zn.XHR_RESPONSE_TYPE.TEXT,txt:zn.XHR_RESPONSE_TYPE.TEXT,ttf:zn.XHR_RESPONSE_TYPE.BUFFER,otf:zn.XHR_RESPONSE_TYPE.BUFFER},zn.EMPTY_GIF="";var Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var Vn=window.URL||window.webkitURL;var Wn={caching:function(t,e){var i=this;Ln[t.url]?(t.data=Ln[t.url],t.complete()):t.onComplete.once(function(){return Ln[i.url]=i.data}),e()},parsing:function(t,e){if(t.data){if(t.xhr&&t.xhrType===zn.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=Vn.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=zn.TYPE.IMAGE,void(t.data.onload=function(){Vn.revokeObjectURL(i),t.data.onload=null,e()})}}else{var r=t.xhr.getResponseHeader("content-type");if(r&&0===r.indexOf("image"))return t.data=new Image,t.data.src="data:"+r+";base64,"+function(t){for(var e="",i=0;i<t.length;){for(var r=[0,0,0],n=[0,0,0,0],o=0;o<r.length;++o)i<t.length?r[o]=255&t.charCodeAt(i++):r[o]=0;switch(n[0]=r[0]>>2,n[1]=(3&r[0])<<4|r[1]>>4,n[2]=(15&r[1])<<2|r[2]>>6,n[3]=63&r[2],i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var s=0;s<n.length;++s)e+=Yn.charAt(n[s])}return e}(t.xhr.responseText),t.type=zn.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}},qn=/(#[\w-]+)?$/,Jn=function(){function t(e,i){var r=this;void 0===e&&(e=""),void 0===i&&(i=10),this.baseUrl=e,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this._queue=Fn(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new Mn.a,this.onError=new Mn.a,this.onLoad=new Mn.a,this.onStart=new Mn.a,this.onComplete=new Mn.a;for(var n=0;n<t._defaultBeforeMiddleware.length;++n)this.pre(t._defaultBeforeMiddleware[n]);for(var o=0;o<t._defaultAfterMiddleware.length;++o)this.use(t._defaultAfterMiddleware[o])}var e=t.prototype;return e.add=function(t,e,i,r){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(r=e||t.callback||t.onComplete,i=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(r=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof i&&(r=i,i=null),this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new zn(t,e,i),"function"==typeof r&&this.resources[t].onAfterMiddleware.once(r),this.loading){for(var o=i.parentResource,s=[],a=0;a<o.children.length;++a)o.children[a].isComplete||s.push(o.children[a]);var h=o.progressChunk*(s.length+1)/(s.length+2);o.children.push(this.resources[t]),o.progressChunk=h;for(var u=0;u<s.length;++u)s[u].progressChunk=h;this.resources[t].progressChunk=h}return this._queue.push(this.resources[t]),this},e.pre=function(t){return this._beforeMiddleware.push(t),this},e.use=function(t){return this._afterMiddleware.push(t),this},e.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort()}return this.resources={},this},e.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},e._prepareUrl=function(t){var e,i=On()(t,{strictMode:!0});if(e=i.protocol||!i.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var r=qn.exec(e)[0];-1!==(e=e.substr(0,e.length-r.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=r}return e},e._loadResource=function(t,e){var i=this;t._dequeue=e,Rn(this._beforeMiddleware,function(e,r){e.call(i,t,function(){r(t.isComplete?{}:null)})},function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())},!0)},e._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},e._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},e._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),Rn(this._afterMiddleware,function(i,r){i.call(e,t,r)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()},!0)},Bn(t,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),t}();Jn._defaultBeforeMiddleware=[],Jn._defaultAfterMiddleware=[],Jn.pre=function(t){return Jn._defaultBeforeMiddleware.push(t),Jn},Jn.use=function(t){return Jn._defaultAfterMiddleware.push(t),Jn};
/*!
 * @pixi/loaders - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/loaders is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Zn=function(){};Zn.use=function(t,e){t.data&&t.type===zn.TYPE.IMAGE&&(t.texture=Ie.fromLoader(t.data,t.url,t.name)),e()};var Kn=function(t){function e(i,r){var n=this;t.call(this,i,r),f.a.call(this);for(var o=0;o<e._plugins.length;++o){var s=e._plugins[o],a=s.pre,h=s.use;a&&this.pre(a),h&&this.use(h)}this.onStart.add(function(t){return n.emit("start",t)}),this.onProgress.add(function(t,e){return n.emit("progress",t,e)}),this.onError.add(function(t,e,i){return n.emit("error",t,e,i)}),this.onLoad.add(function(t,e){return n.emit("load",t,e)}),this.onComplete.add(function(t,e){return n.emit("complete",t,e)}),this._protected=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={shared:{configurable:!0}};return e.prototype.destroy=function(){this._protected||(this.removeAllListeners(),this.reset())},i.shared.get=function(){var t=e._shared;return t||((t=new e)._protected=!0,e._shared=t),t},Object.defineProperties(e,i),e}(Jn);Object.assign(Kn.prototype,f.a.prototype),Kn._plugins=[],Kn.registerPlugin=function(t){return Kn._plugins.push(t),t.add&&t.add(),Kn},Kn.registerPlugin({use:Wn.parsing}),Kn.registerPlugin(Zn);var Qn=function(){};Qn.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Kn.shared:new Kn},Qn.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)};var $n=zn,to=function(t){function e(e,i,r,n){void 0===e&&(e=1500),void 0===r&&(r=16384),void 0===n&&(n=!1),t.call(this);r>16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=b.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(i),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0}};return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,U(t,this.tintRgb)},e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(e.prototype,i),e}(Vt),eo=function(t,e,i){this.geometry=new ze,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var r=0;r<t.length;++r){var n=t[r];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||S.FLOAT,offset:n.offset},e[r]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};
/*!
 * @pixi/particles - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/particles is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */eo.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new Le(q(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){var r=this.dynamicProperties[i];r.offset=e,e+=r.size,this.dynamicStride+=r.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new Le(this.dynamicData,!1,!1);var o=0;this.staticStride=0;for(var s=0;s<this.staticProperties.length;++s){var a=this.staticProperties[s];a.offset=o,o+=a.size,this.staticStride+=a.size}var h=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(h),this.staticDataUint32=new Uint32Array(h),this.staticBuffer=new Le(this.staticData,!0,!1);for(var u=0;u<this.dynamicProperties.length;++u){var l=this.dynamicProperties[u];t.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===S.UNSIGNED_BYTE,l.type,4*this.dynamicStride,4*l.offset)}for(var c=0;c<this.staticProperties.length;++c){var d=this.staticProperties[c];t.addAttribute(d.attributeName,this.staticBuffer,0,d.type===S.UNSIGNED_BYTE,d.type,4*this.staticStride,4*d.offset)}},eo.prototype.uploadDynamic=function(t,e,i){for(var r=0;r<this.dynamicProperties.length;r++){var n=this.dynamicProperties[r];n.uploadFunction(t,e,i,n.type===S.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},eo.prototype.uploadStatic=function(t,e,i){for(var r=0;r<this.staticProperties.length;r++){var n=this.staticProperties[r];n.uploadFunction(t,e,i,n.type===S.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},eo.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var io="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n    vec2 v = vec2(x, y);\n    v = v + aPositionCoord;\n\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vColor = aColor * uColor;\n}\n",ro="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n    gl_FragColor = color;\n}",no=function(t){function e(e){t.call(this,e),this.shader=null,this.properties=null,this.tempMatrix=new Et,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:S.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=Pi.from(io,ro,{})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t){var e=t.children,i=t._maxSize,r=t._batchSize,n=this.renderer,o=e.length;if(0!==o){o>i&&!t.autoResize&&(o=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(G(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Y(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;c<o;c+=r,d+=1){var p=o-c;p>r&&(p=r),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var g=t._bufferUpdateIDs[d]||0;(l=l||f._updateID<g)&&(f._updateID=t._updateID,f.uploadStatic(e,c,p)),n.geometry.bind(f.geometry),h.drawElements(h.TRIANGLES,6*p,h.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,n=t._properties,o=0;o<i;o+=r)e.push(new eo(this.properties,n,r));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new eo(this.properties,i,e)},e.prototype.uploadVertices=function(t,e,i,r,n,o){for(var s=0,a=0,h=0,u=0,l=0;l<i;++l){var c=t[e+l],d=c._texture,p=c.scale.x,f=c.scale.y,g=d.trim,v=d.orig;g?(s=(a=g.x-c.anchor.x*v.width)+g.width,h=(u=g.y-c.anchor.y*v.height)+g.height):(s=v.width*(1-c.anchor.x),a=v.width*-c.anchor.x,h=v.height*(1-c.anchor.y),u=v.height*-c.anchor.y),r[o]=a*p,r[o+1]=u*f,r[o+n]=s*p,r[o+n+1]=u*f,r[o+2*n]=s*p,r[o+2*n+1]=h*f,r[o+3*n]=a*p,r[o+3*n+1]=h*f,o+=4*n}},e.prototype.uploadPosition=function(t,e,i,r,n,o){for(var s=0;s<i;s++){var a=t[e+s].position;r[o]=a.x,r[o+1]=a.y,r[o+n]=a.x,r[o+n+1]=a.y,r[o+2*n]=a.x,r[o+2*n+1]=a.y,r[o+3*n]=a.x,r[o+3*n+1]=a.y,o+=4*n}},e.prototype.uploadRotation=function(t,e,i,r,n,o){for(var s=0;s<i;s++){var a=t[e+s].rotation;r[o]=a,r[o+n]=a,r[o+2*n]=a,r[o+3*n]=a,o+=4*n}},e.prototype.uploadUvs=function(t,e,i,r,n,o){for(var s=0;s<i;++s){var a=t[e+s]._texture._uvs;a?(r[o]=a.x0,r[o+1]=a.y0,r[o+n]=a.x1,r[o+n+1]=a.y1,r[o+2*n]=a.x2,r[o+2*n+1]=a.y2,r[o+3*n]=a.x3,r[o+3*n+1]=a.y3,o+=4*n):(r[o]=0,r[o+1]=0,r[o+n]=0,r[o+n+1]=0,r[o+2*n]=0,r[o+2*n+1]=0,r[o+3*n]=0,r[o+3*n+1]=0,o+=4*n)}},e.prototype.uploadTint=function(t,e,i,r,n,o){for(var s=0;s<i;++s){var a=t[e+s],h=a._texture.baseTexture.premultiplyAlpha,u=a.alpha,l=u<1&&h?V(a._tintRGB,u):a._tintRGB+(255*u<<24);r[o]=l,r[o+n]=l,r[o+2*n]=l,r[o+3*n]=l,o+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Je),oo=function(t,e,i){void 0===i&&(i=null),this.baseTexture=t,this.textures={},this.animations={},this.data=e,this.resolution=this._updateResolution(i||(this.baseTexture.resource?this.baseTexture.resource.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null},so={BATCH_SIZE:{configurable:!0}};so.BATCH_SIZE.get=function(){return 1e3},oo.prototype._updateResolution=function(t){var e=this.data.meta.scale,i=ft(t,null);return null===i&&(i=void 0!==e?parseFloat(e):1),1!==i&&this.baseTexture.setResolution(i),i},oo.prototype.parse=function(t){this._batchIndex=0,this._callback=t,this._frameKeys.length<=oo.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},oo.prototype._processFrames=function(t){for(var e=t,i=oo.BATCH_SIZE;e-t<i&&e<this._frameKeys.length;){var r=this._frameKeys[e],n=this._frames[r],o=n.frame;if(o){var s=null,a=null,h=!1!==n.trimmed&&n.sourceSize?n.sourceSize:n.frame,u=new Lt(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);s=n.rotated?new Lt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):new Lt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),!1!==n.trimmed&&n.spriteSourceSize&&(a=new Lt(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[r]=new Ie(this.baseTexture,s,u,a,n.rotated?2:0,n.anchor),Ie.addToCache(this.textures[r],r)}e++}},oo.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var i=0;i<t[e].length;i++){var r=t[e][i];this.animations[e].push(this.textures[r])}}},oo.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},oo.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*oo.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*oo.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},oo.prototype.destroy=function(t){for(var e in void 0===t&&(t=!1),this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&this.baseTexture.destroy(),this.baseTexture=null},Object.defineProperties(oo,so);var ao=function(){};ao.use=function(t,e){var i=t.name+"_image";if(t.data&&t.type===$n.TYPE.JSON&&t.data.frames&&!this.resources[i]){var r={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},n=ao.getResourcePath(t,this.baseUrl);this.add(i,n,r,function(i){if(i.error)e(i.error);else{var r=new oo(i.texture.baseTexture,t.data,t.url);r.parse(function(){t.spritesheet=r,t.textures=r.textures,e()})}})}else e()},ao.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:_.a.resolve(t.url.replace(e,""),t.data.meta.image)};
/*!
 * @pixi/sprite-tiling - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/sprite-tiling is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var ho=new yt,uo=function(t){function e(e,i,r){void 0===i&&(i=100),void 0===r&&(r=100),t.call(this,e),this.tileTransform=new kt,this._width=i,this._height=r,this._canvasPattern=null,this.uvMatrix=e.uvMatrix||new ki(e),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={clampMargin:{configurable:!0},tileScale:{configurable:!0},tilePosition:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return i.clampMargin.get=function(){return this.uvMatrix.clampMargin},i.clampMargin.set=function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},i.tileScale.get=function(){return this.tileTransform.scale},i.tileScale.set=function(t){this.tileTransform.scale.copyFrom(t)},i.tilePosition.get=function(){return this.tileTransform.position},i.tilePosition.set=function(t){this.tileTransform.position.copyFrom(t)},e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,i,r)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Lt),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,ho);var e=this._width,i=this._height,r=-e*this.anchor._x;if(ho.x>=r&&ho.x<r+e){var n=-i*this.anchor._y;if(ho.y>=n&&ho.y<n+i)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,i,r){return new e(Ie.from(t),i,r)},e.fromFrame=function(t,i,r){var n=rt[t];if(!n)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new e(n,i,r)},e.fromImage=function(t,i,r,n){return n&&"object"!=typeof n&&(n={scaleMode:arguments[4],resourceOptions:{crossorigin:arguments[3]}}),new e(Ie.from(t,n),i,r)},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t},Object.defineProperties(e.prototype,i),e}(Kr),lo="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",co="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 sample = texture2D(uSampler, coord);\n    gl_FragColor = sample * uColor;\n}\n",po="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 sample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = sample * uColor;\n}\n",fo=new Et,go=function(t){function e(e){t.call(this,e);var i={globals:this.renderer.globalUniforms};this.shader=Pi.from(lo,co,i),this.simpleShader=Pi.from(lo,po,i),this.quad=new Ge}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t){var e=this.renderer,i=this.quad,r=i.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((r=i.uvs)[0]=r[6]=-t.anchor.x,r[1]=r[3]=-t.anchor.y,r[2]=r[4]=1-t.anchor.x,r[5]=r[7]=1-t.anchor.y),i.invalidate();var n=t._texture,o=n.baseTexture,s=t.tileTransform.localTransform,a=t.uvMatrix,h=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;h&&(o._glTextures[e.CONTEXT_UID]?h=o.wrapMode!==C:o.wrapMode===C&&(o.wrapMode=O));var u=h?this.simpleShader:this.shader,l=n.width,c=n.height,d=t._width,p=t._height;fo.set(s.a*l/d,s.b*l/p,s.c*c/d,s.d*c/p,s.tx/d,s.ty/p),fo.invert(),h?fo.prepend(a.mapCoord):(u.uniforms.uMapCoord=a.mapCoord.toArray(!0),u.uniforms.uClampFrame=a.uClampFrame,u.uniforms.uClampOffset=a.uClampOffset),u.uniforms.uTransform=fo.toArray(!0),u.uniforms.uColor=W(t.tint,t.worldAlpha,u.uniforms.uColor,o.premultiplyAlpha),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.uSampler=n,e.shader.bind(u),e.geometry.bind(i),e.state.setBlendMode(G(t.blendMode,o.premultiplyAlpha)),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(Je),vo=function(t){function e(e,i){var r=this;void 0===i&&(i={}),t.call(this),this._textWidth=0,this._textHeight=0,this._glyphs=[],this._font={tint:void 0!==i.tint?i.tint:16777215,align:i.align||"left",name:null,size:0},this.font=i.font,this._text=e,this._maxWidth=0,this._maxLineHeight=0,this._letterSpacing=0,this._anchor=new _t(function(){r.dirty=!0},this,0,0),this.dirty=!1,this.roundPixels=d.ROUND_PIXELS,this.updateText()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={tint:{configurable:!0},align:{configurable:!0},anchor:{configurable:!0},font:{configurable:!0},text:{configurable:!0},maxWidth:{configurable:!0},maxLineHeight:{configurable:!0},textWidth:{configurable:!0},letterSpacing:{configurable:!0},textHeight:{configurable:!0}};return e.prototype.updateText=function(){for(var t=e.fonts[this._font.name],i=this._font.size/t.size,r=new yt,n=[],o=[],s=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",a=s.length,h=this._maxWidth*t.size/this._font.size,u=null,l=0,c=0,d=0,p=-1,f=0,g=0,v=0,y=0;y<a;y++){var _=s.charCodeAt(y),m=s.charAt(y);if(/(?:\s)/.test(m)&&(p=y,f=l),"\r"!==m&&"\n"!==m){var x=t.chars[_];x&&(u&&x.kerning[u]&&(r.x+=x.kerning[u]),n.push({texture:x.texture,line:d,charCode:_,position:new yt(r.x+x.xOffset+this._letterSpacing/2,r.y+x.yOffset)}),r.x+=x.xAdvance+this._letterSpacing,l=r.x,v=Math.max(v,x.yOffset+x.texture.height),u=_,-1!==p&&h>0&&r.x>h&&(J(n,1+p-++g,1+y-p),y=p,p=-1,o.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++g,r.x=0,r.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var w=[],T=0;T<=d;T++){var E=0;"right"===this._font.align?E=c-o[T]:"center"===this._font.align&&(E=(c-o[T])/2),w.push(E)}for(var S=n.length,P=this.tint,A=0;A<S;A++){var C=this._glyphs[A];C?C.texture=n[A].texture:((C=new Kr(n[A].texture)).roundPixels=this.roundPixels,this._glyphs.push(C)),C.position.x=(n[A].position.x+w[n[A].line])*i,C.position.y=n[A].position.y*i,C.scale.x=C.scale.y=i,C.tint=P,C.parent||this.addChild(C)}for(var O=S;O<this._glyphs.length;++O)this.removeChild(this._glyphs[O]);if(this._textWidth=c*i,this._textHeight=(r.y+t.lineHeight)*i,0!==this.anchor.x||0!==this.anchor.y)for(var I=0;I<S;I++)this._glyphs[I].x-=this._textWidth*this.anchor.x,this._glyphs[I].y-=this._textHeight*this.anchor.y;this._maxLineHeight=v*i},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},i.tint.get=function(){return this._font.tint},i.tint.set=function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=ft(s[0].getAttribute("file"),d.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof Ie&&(i=[i]);for(var u=0;u<s.length;u++){var l=s[u].getAttribute("id"),c=s[u].getAttribute("file");h[l]=i instanceof Array?i[u]:i[c]}for(var p=t.getElementsByTagName("char"),f=0;f<p.length;f++){var g=p[f],v=parseInt(g.getAttribute("id"),10),y=g.getAttribute("page")||0,_=new Lt(parseInt(g.getAttribute("x"),10)/a+h[y].frame.x/a,parseInt(g.getAttribute("y"),10)/a+h[y].frame.y/a,parseInt(g.getAttribute("width"),10)/a,parseInt(g.getAttribute("height"),10)/a);r.chars[v]={xOffset:parseInt(g.getAttribute("xoffset"),10)/a,yOffset:parseInt(g.getAttribute("yoffset"),10)/a,xAdvance:parseInt(g.getAttribute("xadvance"),10)/a,kerning:{},texture:new Ie(h[y].baseTexture,_),page:y}}for(var m=t.getElementsByTagName("kerning"),x=0;x<m.length;x++){var b=m[x],w=parseInt(b.getAttribute("first"),10)/a,T=parseInt(b.getAttribute("second"),10)/a,E=parseInt(b.getAttribute("amount"),10)/a;r.chars[T]&&(r.chars[T].kerning[w]=E)}return e.fonts[r.font]=r,r},Object.defineProperties(e.prototype,i),e}(Vt);vo.fonts={};var yo=function(){};yo.parse=function(t,e){t.bitmapFont=vo.registerFont(t.data,e)},yo.add=function(){$n.setExtensionXhrType("fnt",$n.XHR_RESPONSE_TYPE.DOCUMENT)},yo.dirname=function(t){var e=t.replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},yo.use=function(t,e){if(t.data&&t.type===$n.TYPE.XML)if(0!==t.data.getElementsByTagName("page").length&&0!==t.data.getElementsByTagName("info").length&&null!==t.data.getElementsByTagName("info")[0].getAttribute("face")){var i=t.isDataUrl?"":yo.dirname(t.url);t.isDataUrl&&("."===i&&(i=""),this.baseUrl&&i&&"/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(i+="/")),(i=i.replace(this.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/");for(var r=t.data.getElementsByTagName("page"),n={},o=function(i){n[i.metadata.pageFile]=i.texture,Object.keys(n).length===r.length&&(yo.parse(t,n),e())},s=0;s<r.length;++s){var a=r[s].getAttribute("file"),h=i+a,u=!1;for(var l in this.resources){var c=this.resources[l];if(c.url===h){c.metadata.pageFile=a,c.texture?o(c):c.onAfterMiddleware.add(o),u=!0;break}}if(!u){var d={crossOrigin:t.crossOrigin,loadType:$n.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:a},t.metadata.imageMetadata),parentResource:t};this.add(h,d,o)}}}else e();else e()};["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");var _o="varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n",mo=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,rr,_o,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),r=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[i+(1-i)*n,n*(1-i)-o*r,n*(1-i)+o*r,0,0,n*(1-i)+o*r,i+n*(1-i),n*(1-i)-o*r,0,0,n*(1-i)-o*r,n*(1-i)+o*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,r,n){var o=((i=i||16770432)>>16&255)/255,s=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(Ii);mo.prototype.grayscale=mo.prototype.greyscale;
/*!
 * @pixi/filter-displacement - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/filter-displacement is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var xo=new Et;Gt.prototype._cacheAsBitmap=!1,Gt.prototype._cacheData=!1;var bo=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Gt.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new bo),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Gt.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Gt.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(d.RESOLUTION);var n=t.renderTexture.current,o=t.renderTexture.sourceFrame,s=t.projection.transform,a=De.create(i.width,i.height),h="cacheAsBitmap_"+K();this._cacheData.textureCacheId=h,ge.addToCache(a.baseTexture,h),Ie.addToCache(a,h);var u=xo;u.tx=-i.x,u.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,a,!0,u,!0),t.projection.transform=s,t.renderTexture.bind(n,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var l=new Kr(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-i.x/i.width,l.anchor.y=-i.y/i.height,l.alpha=e,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)}},Gt.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Gt.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(d.RESOLUTION);var n=De.create(e.width,e.height),o="cacheAsBitmap_"+K();this._cacheData.textureCacheId=o,ge.addToCache(n.baseTexture,o),Ie.addToCache(n,o);var s=xo;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Kr(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Gt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Gt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Gt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ge.removeFromCache(this._cacheData.textureCacheId),Ie.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Gt.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},
/*!
 * @pixi/mixin-get-child-by-name - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/mixin-get-child-by-name is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
Gt.prototype.name=null,Vt.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null},
/*!
 * @pixi/mixin-get-global-position - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/mixin-get-global-position is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
Gt.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new yt),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};
/*!
 * @pixi/mesh - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/mesh is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var wo=function(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};wo.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}};var To=new yt,Eo=new Ht,So=function(t){function e(e,i,r,n){void 0===n&&(n=w.TRIANGLES),t.call(this),this.geometry=e,e.refCount++,this.shader=i,this.state=r||Ci.for2d(),this.drawMode=n,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=0,this._transformID=-1,this.tint=16777215,this.blendMode=b.NORMAL,this._roundPixels=d.ROUND_PIXELS,this.batchUvs=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return i.uvBuffer.get=function(){return this.geometry.buffers[1]},i.verticesBuffer.get=function(){return this.geometry.buffers[0]},i.material.set=function(t){this.shader=t},i.material.get=function(){return this.shader},i.blendMode.set=function(t){this.state.blendMode=t},i.blendMode.get=function(){return this.state.blendMode},i.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},i.roundPixels.get=function(){return this._roundPixels},i.tint.get=function(){return this.shader.tint},i.tint.set=function(t){this.shader.tint=t},i.texture.get=function(){return this.shader.texture},i.texture.set=function(t){this.shader.texture=t},e.prototype._render=function(t){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===w.TRIANGLES&&i.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var i=this.transform.worldTransform,r=i.a,n=i.b,o=i.c,s=i.d,a=i.tx,h=i.ty,u=this.vertexData,l=0;l<u.length/2;l++){var c=e[2*l],d=e[2*l+1];u[2*l]=r*c+o*d+a,u[2*l+1]=n*c+s*d+h}if(this._roundPixels)for(var p=0;p<u.length;p++)u[p]=Math.round(u[p]);this.vertexDirty=t.vertexDirtyId}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new wo(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,To);for(var e=this.geometry.getBuffer("aVertexPosition").data,i=Eo.points,r=this.geometry.getIndex().data,n=r.length,o=4===this.drawMode?3:1,s=0;s+2<n;s+=o){var a=2*r[s],h=2*r[s+1],u=2*r[s+2];if(i[0]=e[a],i[1]=e[a+1],i[2]=e[h],i[3]=e[h+1],i[4]=e[u],i[5]=e[u+1],Eo.contains(To.x,To.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Object.defineProperties(e.prototype,i),e}(Vt);So.BATCHABLE_SIZE=100;var Po="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n",Ao="varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n",Co=function(t){function e(e,i){var r={uSampler:e,alpha:1,uTextureMatrix:Et.IDENTITY,uColor:new Float32Array([1,1,1,1])};(i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i)).uniforms&&Object.assign(r,i.uniforms),t.call(this,i.program||Ei.from(Po,Ao),r),this._colorDirty=!1,this.uvMatrix=new ki(e),this.batchable=void 0===i.program,this.pluginName=i.pluginName,this.tint=i.tint,this.alpha=i.alpha}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={texture:{configurable:!0},alpha:{configurable:!0},tint:{configurable:!0}};return i.texture.get=function(){return this.uniforms.uSampler},i.texture.set=function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},i.alpha.set=function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},i.alpha.get=function(){return this._alpha},i.tint.set=function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},i.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;W(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,i),e}(Pi),Oo=function(t){function e(e,i,r){t.call(this);var n=new Le(e),o=new Le(i,!0),s=new Le(r,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,S.FLOAT).addAttribute("aTextureCoord",o,2,!1,S.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexDirtyId:{configurable:!0}};return i.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,i),e}(ze),Io=function(t){function e(e,i,r,n){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===n&&(n=10),t.call(this),this.segWidth=r,this.segHeight=n,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*s,l*a),i.push(u/n,l/o)}for(var c=n*o,d=0;d<c;d++){var p=d%n,f=d/n|0,g=f*this.segWidth+p,v=f*this.segWidth+p+1,y=(f+1)*this.segWidth+p,_=(f+1)*this.segWidth+p+1;r.push(g,v,y,v,_,y)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(r),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Oo),Mo=function(t){function e(e,i){void 0===e&&(e=200),t.call(this,new Float32Array(4*i.length),new Float32Array(4*i.length),new Uint16Array(6*(i.length-1))),this.points=i,this.width=e,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),r=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),i.data=new Float32Array(4*t.length),r.data=new Uint16Array(6*(t.length-1)));var n=i.data,o=r.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var s=t.length,a=0;a<s;a++){var h=4*a,u=a/(s-1);n[h]=u,n[h+1]=0,n[h+2]=u,n[h+3]=1}for(var l=0,c=0;c<s-1;c++){var d=2*c;o[l++]=d,o[l++]=d+1,o[l++]=d+2,o[l++]=d+2,o[l++]=d+1,o[l++]=d+3}i.update(),r.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,i=t[0],r=0,n=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var h=t[a],u=4*a;n=-((e=a<t.length-1?t[a+1]:h).x-i.x),r=e.y-i.y;var l=Math.sqrt(r*r+n*n),c=this.width/2;r/=l,n/=l,r*=c,n*=c,o[u]=h.x+r,o[u+1]=h.y+n,o[u+2]=h.x-r,o[u+3]=h.y-n,i=h}this.buffers[0].update()}},e.prototype.update=function(){this.updateVertices()},e}(Oo),Do=function(t){function e(e,i){var r=new Mo(e.height,i),n=new Co(e);t.call(this,r,n),this.autoUpdate=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._render=function(e){(this.autoUpdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),t.prototype._render.call(this,e)},e}(So),Ro=function(t){function e(e,i,r){var n=new Io(e.width,e.height,i,r),o=new Co(Ie.WHITE);t.call(this,n,o),this.texture=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={texture:{configurable:!0}};return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this.geometry.width=this.shader.texture.width,this.geometry.height=this.shader.texture.height,this.geometry.build()},i.texture.set=function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},i.texture.get=function(){return this.shader.texture},e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},Object.defineProperties(e.prototype,i),e}(So),ko=function(t){function e(e,i,r,n,o){void 0===e&&(e=Ie.EMPTY);var s=new Oo(i,r,n);s.getBuffer("aVertexPosition").static=!1;var a=new Co(e);t.call(this,s,a,null,o),this.autoUpdate=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertices:{configurable:!0}};return i.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},i.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},Object.defineProperties(e.prototype,i),e}(So),Fo=10,Lo=function(t){function e(e,i,r,n,o){t.call(this,Ie.WHITE,4,4),this._origWidth=e.orig.width,this._origHeight=e.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=void 0!==i?i:Fo,this._rightWidth=void 0!==n?n:Fo,this._topHeight=void 0!==r?r:Fo,this._bottomHeight=void 0!==o?o:Fo,this.texture=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertices:{configurable:!0},width:{configurable:!0},height:{configurable:!0},leftWidth:{configurable:!0},rightWidth:{configurable:!0},topHeight:{configurable:!0},bottomHeight:{configurable:!0}};return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},i.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},i.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._topHeight+this._bottomHeight,i=this._height>e?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},i.width.get=function(){return this._width},i.width.set=function(t){this._width=t,this._refresh()},i.height.get=function(){return this._height},i.height.set=function(t){this._height=t,this._refresh()},i.leftWidth.get=function(){return this._leftWidth},i.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},i.rightWidth.get=function(){return this._rightWidth},i.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},i.topHeight.get=function(){return this._topHeight},i.topHeight.set=function(t){this._topHeight=t,this._refresh()},i.bottomHeight.get=function(){return this._bottomHeight},i.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,i),e}(Ro),No=function(t){function e(e,i){t.call(this,e[0]instanceof Ie?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&re.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&re.shared.add(this.update,this,Qt))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i?this.onLoop():this.animationSpeed<0&&this.currentFrame>i&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],r=0;r<t.length;++r)i.push(Ie.from(t[r]));return new e(i)},e.fromImages=function(t){for(var i=[],r=0;r<t.length;++r)i.push(Ie.from(t[r]));return new e(i)},i.totalFrames.get=function(){return this._textures.length},i.textures.get=function(){return this._textures},i.textures.set=function(t){if(t[0]instanceof Ie)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this.gotoAndStop(0),this.updateTexture()},i.currentFrame.get=function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},Object.defineProperties(e.prototype,i),e}(Kr);ir.registerPlugin("accessibility",qt),ir.registerPlugin("extract",vr),ir.registerPlugin("interaction",Sr),ir.registerPlugin("particle",no),ir.registerPlugin("prepare",xn),ir.registerPlugin("batch",fr),ir.registerPlugin("tilingSprite",go),Kn.registerPlugin(yo),Kn.registerPlugin(ao),Sn.registerPlugin(se),Sn.registerPlugin(Qn);var Bo=function(t){this.renderer=t};function Uo(t){var e=document.createElement("canvas");e.width=6,e.height=1;var i=e.getContext("2d");return i.fillStyle=t,i.fillRect(0,0,6,1),e}function jo(){if("undefined"==typeof document)return!1;var t=Uo("#ff00ff"),e=Uo("#ffff00"),i=document.createElement("canvas");i.width=6,i.height=1;var r=i.getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(t,0,0),r.drawImage(e,2,0);var n=r.getImageData(2,0,1,1);if(!n)return!1;var o=n.data;return 255===o[0]&&0===o[1]&&0===o[2]}Bo.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var i=t.alpha,r=t.transform.worldTransform,n=e.resolution;e.context.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=i},Bo.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,i=t.geometry.graphicsData,r=i.length;if(0!==r){e.beginPath();for(var n=0;n<r;n++){var o=i[n],s=o.shape;if(o.type===Tt.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;h<a.length/2;h++)e.lineTo(a[2*h],a[2*h+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(o.type===Tt.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(o.type===Tt.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(o.type===Tt.ELIP){var u=2*s.width,l=2*s.height,c=s.x-u/2,d=s.y-l/2,p=u/2*.5522848,f=l/2*.5522848,g=c+u,v=d+l,y=c+u/2,_=d+l/2;e.moveTo(c,_),e.bezierCurveTo(c,_-f,y-p,d,y,d),e.bezierCurveTo(y+p,d,g,_-f,g,_),e.bezierCurveTo(g,_+f,y+p,v,y,v),e.bezierCurveTo(y-p,v,c,_+f,c,_),e.closePath()}else if(o.type===Tt.RREC){var m=s.x,x=s.y,b=s.width,w=s.height,T=s.radius,E=Math.min(b,w)/2|0;T=T>E?E:T,e.moveTo(m,x+T),e.lineTo(m,x+w-T),e.quadraticCurveTo(m,x+w,m+T,x+w),e.lineTo(m+b-T,x+w),e.quadraticCurveTo(m+b,x+w,m+b,x+w-T),e.lineTo(m+b,x+T),e.quadraticCurveTo(m+b,x,m+b-T,x),e.lineTo(m+T,x),e.quadraticCurveTo(m,x,m,x+T),e.closePath()}}}},Bo.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},Bo.prototype.destroy=function(){};var Ho=function(t){function e(i,r,n){var o;t.call(this,"Canvas",i,r,n),this.type=x.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.context=this.rootContext,this.refresh=!0,this.maskManager=new Bo(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(e.__plugins),this.blendModes=(void 0===o&&(o=[]),jo()?(o[b.NORMAL]="source-over",o[b.ADD]="lighter",o[b.MULTIPLY]="multiply",o[b.SCREEN]="screen",o[b.OVERLAY]="overlay",o[b.DARKEN]="darken",o[b.LIGHTEN]="lighten",o[b.COLOR_DODGE]="color-dodge",o[b.COLOR_BURN]="color-burn",o[b.HARD_LIGHT]="hard-light",o[b.SOFT_LIGHT]="soft-light",o[b.DIFFERENCE]="difference",o[b.EXCLUSION]="exclusion",o[b.HUE]="hue",o[b.SATURATION]="saturate",o[b.COLOR]="color",o[b.LUMINOSITY]="luminosity"):(o[b.NORMAL]="source-over",o[b.ADD]="lighter",o[b.MULTIPLY]="source-over",o[b.SCREEN]="source-over",o[b.OVERLAY]="source-over",o[b.DARKEN]="source-over",o[b.LIGHTEN]="source-over",o[b.COLOR_DODGE]="source-over",o[b.COLOR_BURN]="source-over",o[b.HARD_LIGHT]="source-over",o[b.SOFT_LIGHT]="source-over",o[b.DIFFERENCE]="source-over",o[b.EXCLUSION]="source-over",o[b.HUE]="source-over",o[b.SATURATION]="source-over",o[b.COLOR]="source-over",o[b.LUMINOSITY]="source-over"),o[b.NORMAL_NPM]=o[b.NORMAL],o[b.ADD_NPM]=o[b.ADD],o[b.SCREEN_NPM]=o[b.SCREEN],o[b.SRC_IN]="source-in",o[b.SRC_OUT]="source-out",o[b.SRC_ATOP]="source-atop",o[b.DST_OVER]="destination-over",o[b.DST_IN]="destination-in",o[b.DST_OUT]="destination-out",o[b.DST_ATOP]="destination-atop",o[b.SUBTRACT]="source-over",o),this._activeBlendMode=null,this._outerBlend=!1,this.renderingToScreen=!1,N("Canvas"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t,e,i,r,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new ht(e.width,e.height,e.resolution),e.resource=new we.CanvasResource(e._canvasRenderTarget.canvas),e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;r?(r.copyTo(h),this._tempDisplayObjectParent.transform._worldID=-1):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=b.NORMAL,this._outerBlend=!1,s.globalCompositeOperation=this.blendModes[b.NORMAL],(void 0!==i?i:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var u=this.context;this.context=s,t.renderCanvas(this),this.context=u,s.restore(),this.resolution=o,this.emit("postrender")}},e.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},e.prototype.setBlendMode=function(t,e){var i=t===b.SRC_IN||t===b.SRC_OUT||t===b.DST_IN||t===b.DST_ATOP;!e&&i&&(t=b.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=i,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.smoothProperty&&(this.rootContext[this.smoothProperty]=d.SCALE_MODE===P)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(er),zo={getTintedCanvas:function(t,e){var i=t.texture,r="#"+("00000"+(0|(e=zo.roundColor(e))).toString(16)).substr(-6);i.tintCache=i.tintCache||{};var n,o=i.tintCache[r];if(o){if(o.tintId===i._updateID)return i.tintCache[r];n=i.tintCache[r]}else n=zo.canvas||document.createElement("canvas");if(zo.tintMethod(i,e,n),n.tintId=i._updateID,zo.convertTintToImage){var s=new Image;s.src=n.toDataURL(),i.tintCache[r]=s}else i.tintCache[r]=n,zo.canvas=null;return n},tintWithMultiply:function(t,e,i){var r=i.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,i.width=Math.ceil(n.width),i.height=Math.ceil(n.height),r.save(),r.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),r.fillRect(0,0,n.width,n.height),r.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();r.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),r.globalCompositeOperation="destination-atop",r.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),r.restore()},tintWithOverlay:function(t,e,i){var r=i.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,i.width=Math.ceil(n.width),i.height=Math.ceil(n.height),r.save(),r.globalCompositeOperation="copy",r.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),r.fillRect(0,0,n.width,n.height),r.globalCompositeOperation="destination-atop",r.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),r.restore()},tintWithPerPixel:function(t,e,i){var r=i.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,i.width=Math.ceil(n.width),i.height=Math.ceil(n.height),r.save(),r.globalCompositeOperation="copy",r.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),r.restore();for(var s=U(e),a=s[0],h=s[1],u=s[2],l=r.getImageData(0,0,n.width,n.height),c=l.data,d=0;d<c.length;d+=4)c[d+0]*=a,c[d+1]*=h,c[d+2]*=u;r.putImageData(l,0,0)},roundColor:function(t){var e=zo.cacheStepsPerColorChannel,i=U(t);return i[0]=Math.min(255,i[0]/e*e),i[1]=Math.min(255,i[1]/e*e),i[2]=Math.min(255,i[2]/e*e),z(i)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:jo(),tintMethod:function(){}};zo.tintMethod=zo.canUseMultiply?zo.tintWithMultiply:zo.tintWithPerPixel;var Xo=ir.create;ir.create=function(t){if(!(t&&t.forceCanvas))try{return Xo(t)}catch(t){}return new Ho(t)},ge.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:this.source};
/*!
 * @pixi/canvas-mesh - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-mesh is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Go=function(t){this.renderer=t};Go.prototype.render=function(t){var e=this.renderer,i=e.context,r=t.worldTransform,n=e.resolution;t.roundPixels?i.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n|0,r.ty*n|0):i.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n),e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),t.drawMode!==w.TRIANGLES?this._renderTriangleMesh(t):this._renderTriangles(t)},Go.prototype._renderTriangleMesh=function(t){for(var e=t.geometry.buffers[0].data.length,i=0;i<e-2;i++){var r=2*i;this._renderDrawTriangle(t,r,r+2,r+4)}},Go.prototype._renderTriangles=function(t){for(var e=t.geometry.getIndex().data,i=e.length,r=0;r<i;r+=3){var n=2*e[r],o=2*e[r+1],s=2*e[r+2];this._renderDrawTriangle(t,n,o,s)}},Go.prototype._renderDrawTriangle=function(t,e,i,r){var n=this.renderer.context,o=t.geometry.buffers[0].data,s=t.uvs,a=t.texture;if(a.valid){var h=a.baseTexture,u=h.getDrawableSource(),l=h.width,c=h.height,d=s[e]*h.width,p=s[i]*h.width,f=s[r]*h.width,g=s[e+1]*h.height,v=s[i+1]*h.height,y=s[r+1]*h.height,_=o[e],m=o[i],x=o[r],b=o[e+1],w=o[i+1],T=o[r+1],E=t.canvasPadding/this.renderer.resolution;if(E>0){var S=E/Math.abs(t.worldTransform.a),P=E/Math.abs(t.worldTransform.d),A=(_+m+x)/3,C=(b+w+T)/3,O=_-A,I=b-C,M=Math.sqrt(O*O+I*I);_=A+O/M*(M+S),b=C+I/M*(M+P),I=w-C,m=A+(O=m-A)/(M=Math.sqrt(O*O+I*I))*(M+S),w=C+I/M*(M+P),I=T-C,x=A+(O=x-A)/(M=Math.sqrt(O*O+I*I))*(M+S),T=C+I/M*(M+P)}n.save(),n.beginPath(),n.moveTo(_,b),n.lineTo(m,w),n.lineTo(x,T),n.closePath(),n.clip();var D=d*v+g*f+p*y-v*f-g*p-d*y,R=_*v+g*x+m*y-v*x-g*m-_*y,k=d*m+_*f+p*x-m*f-_*p-d*x,F=d*v*x+g*m*f+_*p*y-_*v*f-g*p*x-d*m*y,L=b*v+g*T+w*y-v*T-g*w-b*y,N=d*w+b*f+p*T-w*f-b*p-d*T,B=d*v*T+g*w*f+b*p*y-b*v*f-g*p*T-d*w*y;n.transform(R/D,L/D,k/D,N/D,F/D,B/D),n.drawImage(u,0,0,l*h.resolution,c*h.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},Go.prototype.renderMeshFlat=function(t){var e=this.renderer.context,i=t.geometry.getBuffer("aVertexPosition").data,r=i.length/2;e.beginPath();for(var n=1;n<r-2;++n){var o=2*n,s=i[o],a=i[o+1],h=i[o+2],u=i[o+3],l=i[o+4],c=i[o+5];e.moveTo(s,a),e.lineTo(h,u),e.lineTo(l,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},Go.prototype.destroy=function(){this.renderer=null},d.MESH_CANVAS_PADDING=0,Co.prototype._renderCanvas=function(t,e){t.plugins.mesh.render(e)},Lo.prototype._cachedTint=16777215,Lo.prototype._tintedCanvas=null,Lo.prototype._canvasUvs=null,Lo.prototype._renderCanvas=function(t){var e=t.context,i=this.worldTransform,r=t.resolution,n=16777215!==this.tint,o=this.texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedCanvas=zo.getTintedCanvas(this,this.tint));var s=n?this._tintedCanvas:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var a=this.vertices,h=this._canvasUvs,u=n?0:o.frame.x,l=n?0:o.frame.y,c=u+o.frame.width,d=l+o.frame.height;h[0]=u,h[1]=u+this._leftWidth,h[2]=c-this._rightWidth,h[3]=c,h[4]=l,h[5]=l+this._topHeight,h[6]=d-this._bottomHeight,h[7]=d;for(var p=0;p<8;p++)h[p]*=o.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),this.roundPixels?e.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*r|0,i.ty*r|0):e.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*r,i.ty*r);for(var f=0;f<3;f++)for(var g=0;g<3;g++){var v=2*g+8*f,y=Math.max(1,h[g+1]-h[g]),_=Math.max(1,h[f+5]-h[f+4]),m=Math.max(1,a[v+10]-a[v]),x=Math.max(1,a[v+11]-a[v+1]);e.drawImage(s,h[g],h[f+4],y,_,a[v],a[v+1],m,x)}},So.prototype._renderCanvas=function(t){this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.material._renderCanvas(t,this)},So.prototype._canvasPadding=null,Object.defineProperty(So.prototype,"canvasPadding",{get:function(){return null!==this._canvasPadding?this._canvasPadding:d.MESH_CANVAS_PADDING},set:function(t){this._canvasPadding=t}}),ko.prototype._renderCanvas=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)},Do.prototype._renderCanvas=function(t){(this.autoUpdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)};
/*!
 * @pixi/canvas-graphics - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-graphics is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Yo,Vo=function(t){this.renderer=t};Vo.prototype.render=function(t){var e=this.renderer,i=e.context,r=t.worldAlpha,n=t.transform.worldTransform,o=e.resolution;i.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.canvasTintDirty===t.geometry.dirty&&t._prevTint===t.tint||this.updateGraphicsTint(t),e.setBlendMode(t.blendMode);for(var s=t.geometry.graphicsData,a=0;a<s.length;a++){var h=s[a],u=h.shape,l=h.fillStyle,c=h.lineStyle,d=h._fillTint,p=h._lineTint;if(i.lineWidth=c.width,h.type===Tt.POLY){i.beginPath();var f=u.points,g=h.holes,v=void 0,y=void 0,_=void 0,m=void 0;i.moveTo(f[0],f[1]);for(var x=2;x<f.length;x+=2)i.lineTo(f[x],f[x+1]);if(u.closeStroke&&i.closePath(),g.length>0){v=0,_=f[0],m=f[1];for(var b=2;b+2<f.length;b+=2)v+=(f[b]-_)*(f[b+3]-m)-(f[b+2]-_)*(f[b+1]-m);for(var w=0;w<g.length;w++)if(f=g[w].shape.points){y=0,_=f[0],m=f[1];for(var T=2;T+2<f.length;T+=2)y+=(f[T]-_)*(f[T+3]-m)-(f[T+2]-_)*(f[T+1]-m);if(y*v<0){i.moveTo(f[0],f[1]);for(var E=2;E<f.length;E+=2)i.lineTo(f[E],f[E+1])}else{i.moveTo(f[f.length-2],f[f.length-1]);for(var S=f.length-4;S>=0;S-=2)i.lineTo(f[S],f[S+1])}g[w].shape.closeStroke&&i.closePath()}}l.visible&&(i.globalAlpha=l.alpha*r,i.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*r,i.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),i.stroke())}else if(h.type===Tt.RECT)l.visible&&(i.globalAlpha=l.alpha*r,i.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),i.fillRect(u.x,u.y,u.width,u.height)),c.visible&&(i.globalAlpha=c.alpha*r,i.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),i.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===Tt.CIRC)i.beginPath(),i.arc(u.x,u.y,u.radius,0,2*Math.PI),i.closePath(),l.visible&&(i.globalAlpha=l.alpha*r,i.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*r,i.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),i.stroke());else if(h.type===Tt.ELIP){var P=2*u.width,A=2*u.height,C=u.x-P/2,O=u.y-A/2;i.beginPath();var I=P/2*.5522848,M=A/2*.5522848,D=C+P,R=O+A,k=C+P/2,F=O+A/2;i.moveTo(C,F),i.bezierCurveTo(C,F-M,k-I,O,k,O),i.bezierCurveTo(k+I,O,D,F-M,D,F),i.bezierCurveTo(D,F+M,k+I,R,k,R),i.bezierCurveTo(k-I,R,C,F+M,C,F),i.closePath(),l.visible&&(i.globalAlpha=l.alpha*r,i.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*r,i.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),i.stroke())}else if(h.type===Tt.RREC){var L=u.x,N=u.y,B=u.width,U=u.height,j=u.radius,H=Math.min(B,U)/2|0;j=j>H?H:j,i.beginPath(),i.moveTo(L,N+j),i.lineTo(L,N+U-j),i.quadraticCurveTo(L,N+U,L+j,N+U),i.lineTo(L+B-j,N+U),i.quadraticCurveTo(L+B,N+U,L+B,N+U-j),i.lineTo(L+B,N+j),i.quadraticCurveTo(L+B,N,L+B-j,N),i.lineTo(L+j,N),i.quadraticCurveTo(L,N,L,N+j),i.closePath(),l.visible&&(i.globalAlpha=l.alpha*r,i.fillStyle="#"+("00000"+(0|d).toString(16)).substr(-6),i.fill()),c.visible&&(i.globalAlpha=c.alpha*r,i.strokeStyle="#"+("00000"+(0|p).toString(16)).substr(-6),i.stroke())}}},Vo.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.geometry.dirty;for(var e=(t.tint>>16&255)/255,i=(t.tint>>8&255)/255,r=(255&t.tint)/255,n=t.geometry.graphicsData,o=0;o<n.length;++o){var s=n[o],a=0|s.fillStyle.color,h=0|s.lineStyle.color;s._fillTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*i*255<<8)+(255&a)/255*r*255,s._lineTint=((h>>16&255)/255*e*255<<16)+((h>>8&255)/255*i*255<<8)+(255&h)/255*r*255}},Vo.prototype.destroy=function(){this.renderer=null};var Wo=new Et;qr.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var i=this.getLocalBounds(),r=De.create(i.width,i.height,t,e);Yo||(Yo=new Ho),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Wo),Wo.invert(),Wo.tx-=i.x,Wo.ty-=i.y,Yo.render(this,r,!0,Wo);var n=Ie.from(r.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.resolution=e,n.baseTexture.update(),n},qr.prototype.cachedGraphicsData=[],qr.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};
/*!
 * @pixi/canvas-sprite - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-sprite is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var qo=new Et,Jo=function(t){this.renderer=t};Jo.prototype.render=function(t){var e=t._texture,i=this.renderer,r=i.context,n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,h=0,u=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&u&&e.valid){i.setBlendMode(t.blendMode,!0),i.context.globalAlpha=t.worldAlpha;var l=e.baseTexture.scaleMode===P;i.smoothProperty&&i.context[i.smoothProperty]!==l&&(r[i.smoothProperty]=l),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,h=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,h=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(qo),s=qo,Rt.matrixAppendRotationInv(s,e.rotate,a,h),a=0,h=0),a-=n/2,h-=o/2,t.roundPixels?(i.context.setTransform(s.a,s.b,s.c,s.d,s.tx*i.resolution|0,s.ty*i.resolution|0),a|=0,h|=0):i.context.setTransform(s.a,s.b,s.c,s.d,s.tx*i.resolution,s.ty*i.resolution);var c=e.baseTexture.resolution,d=i._outerBlend;d&&(r.save(),r.beginPath(),r.rect(a*i.resolution,h*i.resolution,n*i.resolution,o*i.resolution),r.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=zo.getTintedCanvas(t,t.tint)),r.drawImage(t._tintedCanvas,0,0,Math.floor(n*c),Math.floor(o*c),Math.floor(a*i.resolution),Math.floor(h*i.resolution),Math.floor(n*i.resolution),Math.floor(o*i.resolution))):r.drawImage(u,e._frame.x*c,e._frame.y*c,Math.floor(n*c),Math.floor(o*c),Math.floor(a*i.resolution),Math.floor(h*i.resolution),Math.floor(n*i.resolution),Math.floor(o*i.resolution)),d&&r.restore(),i.setBlendMode(b.NORMAL)}},Jo.prototype.destroy=function(){this.renderer=null},Kr.prototype._tintedCanvas=null,Kr.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};
/*!
 * @pixi/canvas-extract - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-extract is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Zo=new Lt,Ko=function(t){this.renderer=t,t.extract=this};Ko.prototype.image=function(t,e,i){var r=new Image;return r.src=this.base64(t,e,i),r},Ko.prototype.base64=function(t,e,i){return this.canvas(t).toDataURL(e,i)},Ko.prototype.canvas=function(t){var e,i,r,n,o=this.renderer;t&&(n=t instanceof De?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,i=n.baseTexture._canvasRenderTarget.resolution,r=n.frame):(e=o.rootContext,i=o.resolution,(r=Zo).width=this.renderer.width,r.height=this.renderer.height);var s=Math.floor(r.width*i),a=Math.floor(r.height*i),h=new ht(s,a,1),u=e.getImageData(r.x*i,r.y*i,s,a);return h.context.putImageData(u,0,0),h.canvas},Ko.prototype.pixels=function(t){var e,i,r,n,o=this.renderer;return t&&(n=t instanceof De?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,i=n.baseTexture._canvasRenderTarget.resolution,r=n.frame):(e=o.rootContext,(r=Zo).width=o.width,r.height=o.height),e.getImageData(0,0,r.width*i,r.height*i).data},Ko.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};
/*!
 * @pixi/canvas-prepare - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-prepare is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var Qo=16,$o=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this,this.canvas=document.createElement("canvas"),this.canvas.width=Qo,this.canvas.height=Qo,this.ctx=this.canvas.getContext("2d"),this.registerUploadHook(ts)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(dn);function ts(t,e){if(e instanceof ge){var i=e.source,r=0===i.width?t.canvas.width:Math.min(t.canvas.width,i.width),n=0===i.height?t.canvas.height:Math.min(t.canvas.height,i.height);return t.ctx.drawImage(i,0,0,r,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}
/*!
 * @pixi/canvas-sprite-tiling - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-sprite-tiling is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */uo.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var i=t.context,r=this.worldTransform,n=t.resolution,o=e.baseTexture,s=o.getDrawableSource(),a=o.resolution,h=this.tilePosition.x/this.tileScale.x%e._frame.width*a,u=this.tilePosition.y/this.tileScale.y%e._frame.height*a;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new ht(e._frame.width,e._frame.height,a);16777215!==this.tint?(this._tintedCanvas=zo.getTintedCanvas(this,this.tint),l.context.drawImage(this._tintedCanvas,0,0)):l.context.drawImage(s,-e._frame.x*a,-e._frame.y*a),this._cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}i.globalAlpha=this.worldAlpha,i.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n),t.setBlendMode(this.blendMode),i.fillStyle=this._canvasPattern,i.scale(this.tileScale.x/a,this.tileScale.y/a);var c=this.anchor.x*-this._width,d=this.anchor.y*-this._height;this.uvRespectAnchor?(i.translate(h,u),i.fillRect(-h+c,-u+d,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(i.translate(h+c,u+d),i.fillRect(-h,-u,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},
/*!
 * @pixi/canvas-particles - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-particles is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
to.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,i=this.worldTransform,r=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h<this.children.length;++h){var u=this.children[h];if(u.visible){var l=u._texture.frame;if(e.globalAlpha=this.worldAlpha*u.alpha,u.rotation%(2*Math.PI)==0)r&&(e.setTransform(i.a,i.b,i.c,i.d,i.tx*t.resolution,i.ty*t.resolution),r=!1),n=u.anchor.x*(-l.width*u.scale.x)+u.position.x+.5,o=u.anchor.y*(-l.height*u.scale.y)+u.position.y+.5,s=l.width*u.scale.x,a=l.height*u.scale.y;else{r||(r=!0),u.displayObjectUpdateTransform();var c=u.worldTransform;this.roundPixels?e.setTransform(c.a,c.b,c.c,c.d,c.tx*t.resolution|0,c.ty*t.resolution|0):e.setTransform(c.a,c.b,c.c,c.d,c.tx*t.resolution,c.ty*t.resolution),n=u.anchor.x*-l.width+.5,o=u.anchor.y*-l.height+.5,s=l.width,a=l.height}var d=u._texture.baseTexture.resolution;e.drawImage(u._texture.baseTexture.source,l.x*d,l.y*d,l.width*d,l.height*d,n*t.resolution,o*t.resolution,s*t.resolution,a*t.resolution)}}}},
/*!
 * @pixi/canvas-display - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-display is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
Vt.prototype._renderCanvas=function(t){},Vt.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask),this._renderCanvas(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},Gt.prototype.renderCanvas=function(t){},
/*!
 * @pixi/canvas-text - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * @pixi/canvas-text is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
ln.prototype._renderCanvas=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),Kr.prototype._renderCanvas.call(this,t)},
/*!
 * pixi.js-legacy - v5.1.2
 * Compiled Sat, 24 Aug 2019 01:06:18 UTC
 *
 * pixi.js-legacy is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
Ho.registerPlugin("accessibility",n.AccessibilityManager),Ho.registerPlugin("extract",Ko),Ho.registerPlugin("graphics",Vo),Ho.registerPlugin("interaction",s.InteractionManager),Ho.registerPlugin("mesh",Go),Ho.registerPlugin("prepare",$o),Ho.registerPlugin("sprite",Jo),Object.assign(a,u),Object.assign(o,h);var es=0,is="Arial",rs=24,ns=16777215,os=275;function ss(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var as=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._player=e,this._stageContainer=i,this._container=new Vt,this._container.name="textContainer",this._stageContainer.addChild(this._container),this._textObject=new ln("",{fontFamily:is,fontSize:rs,fill:ns,align:"center",wordWrap:!0,wordWrapWidth:os}),this._textObject.anchor.set(.5),this._container.addChild(this._textObject),this._message={type:null,text:""}}var e,i,r;return e=t,(i=[{key:"resize",value:function(){var t=this._player.viewportSize,e=t.width,i=t.height;this._container&&(this._container.pivot={x:-e/2,y:-i/2})}},{key:"showMessage",value:function(t){if(t&&t.type&&void 0!==t.text&&null!==t.text){var e,i=t.type,r=t.text;switch(i){case"loading":e="Loading... ".concat(r,"%");break;case"error":e="ERROR!\n".concat(r)}e&&(this._textObject.text=e)}}},{key:"destroy",value:function(){this._container&&(this._stageContainer.removeChild(this._container),this._container=null),this._textObject&&(this._textObject.destroy({children:!0,texture:!0,baseTexture:!0}),this._textObject=null)}}])&&ss(e.prototype,i),r&&ss(e,r),t}(),hs=i(4);function us(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ls=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._player=e,this._rootElement=i,this._mc=new hs(this._rootElement),this._mc.on("tap",this._handleTap.bind(this,this._player))}var e,i,r;return e=t,(i=[{key:"adaptToStory",value:function(t,e,i,r,n,o){this._storyData={readingProgression:t,snapBehavior:e,goForward:i,goBackward:r,goToClosestSnapPoint:n,setScrollDelta:o},this._mc.get("swipe").set({direction:hs.DIRECTION_ALL,velocity:10}),this._mc.on("swipeleft swiperight swipeup swipedown",this._handleSwipe.bind(this)),"discontinuous"!==e&&(this._mc.get("pan").set({direction:hs.DIRECTION_ALL}),this._mc.on("panleft panright panup pandown panend",this._onMobileScroll.bind(this))),this._resetScroll()}},{key:"_handleTap",value:function(t,e){if(this._storyData){var i=t.windowSize,r=t.viewportSize,n=i.width,o=i.height,s=(n-r.width)/2;s+=.3*r.width;var a=(o-r.height)/2;a+=.3*r.height;var h=e.center,u=h.x,l=h.y,c=this._storyData,d=c.readingProgression,p=c.goForward,f=c.goBackward;switch(d){case"ltr":u>=n-s?p():u<=s?f():this._doOnCenterTap&&this._doOnCenterTap();break;case"rtl":u<=s?p():u>=n-s?f():this._doOnCenterTap&&this._doOnCenterTap();break;case"ttb":l>=o-a?p():l<=a?f():this._doOnCenterTap&&this._doOnCenterTap();break;case"btt":l<=a?p():l>=o-a?f():this._doOnCenterTap&&this._doOnCenterTap()}}else this._doOnCenterTap&&this._doOnCenterTap()}},{key:"_handleSwipe",value:function(t){var e=this._storyData,i=e.readingProgression,r=e.goForward,n=e.goBackward;switch(i){case"ltr":"swipeleft"===t.type?r():"swiperight"===t.type&&n();break;case"rtl":"swiperight"===t.type?r():"swipeleft"===t.type&&n();break;case"ttb":"swipeup"===t.type?r():"swipedown"===t.type&&n();break;case"btt":"swipedown"===t.type?r():"swipeup"===t.type&&n()}}},{key:"_resetScroll",value:function(){this._lastScrollEvent={deltaX:0,deltaY:0}}},{key:"_onMobileScroll",value:function(t){if("panend"===t.type){var e=this._storyData,i=e.snapBehavior,r=e.goToClosestSnapPoint;switch(i){case"sticky":r();break;default:this._releaseScroll(t)}this._resetScroll()}else if(this._lastScrollEvent){var n={deltaX:this._lastScrollEvent.deltaX-t.deltaX,deltaY:this._lastScrollEvent.deltaY-t.deltaY};this._scroll(n),this._lastScrollEvent=t}}},{key:"_releaseScroll",value:function(t){var e={x:10*t.velocityX,y:10*t.velocityY},i=Date.now();this._autoScroll(e,i)}},{key:"_autoScroll",value:function(t,e){var i=Date.now()-e,r=-t.x*Math.exp(-i/325),n=-t.y*Math.exp(-i/325);Math.abs(r)<1||Math.abs(n)<1?(r=Math.round(2*r)/2,n=Math.round(2*n)/2):(r=Math.round(r),n=Math.round(n)),(Math.abs(r)>.5||Math.abs(n)>.5)&&(this._scroll({deltaX:r,deltaY:n}),requestAnimationFrame(this._autoScroll.bind(this,t,e)))}},{key:"_scroll",value:function(t){(0,this._storyData.setScrollDelta)({deltaX:t.deltaX,deltaY:t.deltaY})}},{key:"_onWheelScroll",value:function(t){t.preventDefault(),this._scroll(t)}},{key:"setOnCenterTapAction",value:function(t){this._doOnCenterTap=t}},{key:"destroy",value:function(){this._mc.off("tap",this._handleTap.bind(this,this._player)),this._mc.off("swipeleft swiperight swipeup swipedown",this._handleSwipe.bind(this)),this._mc.off("panleft panright panup pandown panend",this._onMobileScroll.bind(this))}}])&&us(e.prototype,i),r&&us(e,r),t}();function cs(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ds=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._textManager=e,this._base64DataByHref=i,this._pixiLoader=Kn.shared,this._pixiLoader.reset(),this._totalNbOfResourcesToLoad=0,this._displayLoadingText(0)}var e,i,n;return e=t,(i=[{key:"_displayLoadingText",value:function(t){this._loadPercent=t,this._textManager.showMessage({type:"loading",text:t})}},{key:"addResource",value:function(t){if(t){var e=t.href,i=t.path,r=t.resourceType,n=t.fallbackHref,o=t.fallbackPath;switch(r){case"image":this._addToLoader(i,e);break;case"video":this._addToLoader(o,n)}}}},{key:"_addToLoader",value:function(t,e){t&&!Kn.shared.resources[t]&&(this._base64DataByHref?this._pixiLoader.add(t,this._base64DataByHref[e]):this._pixiLoader.add(t,t),this._totalNbOfResourcesToLoad+=1)}},{key:"loadAllResources",value:function(){var t=this;return new Promise(function(e,i){0===t._totalNbOfResourcesToLoad&&(t._loadPercent=null,i(new Error("No files to load")));t._remainingNbOfResourcesToLoad=t._totalNbOfResourcesToLoad,t._pixiLoader.load(),t._pixiLoader.onProgress.add(function(){t._acknowledgeResourceHandling()}),t._pixiLoader.onError.add(function(){t._acknowledgeResourceHandling()}),t._pixiLoader.onComplete.add(function(){t._loadPercent=null,e()})})}},{key:"_acknowledgeResourceHandling",value:function(){this._remainingNbOfResourcesToLoad-=1;var t=this._totalNbOfResourcesToLoad-this._remainingNbOfResourcesToLoad;t/=this._totalNbOfResourcesToLoad;var e=Math.round(100*t);this._displayLoadingText(e)}},{key:"destroy",value:function(){this._pixiLoader.reset();var t=r.TextureCache;t&&Object.values(t).forEach(function(t){t.destroy(!0)})}}])&&cs(e.prototype,i),n&&cs(e,n),t}();function ps(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function fs(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],r=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(i.push(s.value),!e||i.length!==e);r=!0);}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function gs(t){return!1===Number.isNaN(Number(t))}function vs(t){if(t&&2===t.split(":").length){var e=t.split(":"),i=e[0],r=e[1];if(!0===gs(i)&&!0===gs(r)&&0!==i&&0!==r)return i/r}return null}function ys(t,e){if(!t)return 0;if(!1===function(t){return"string"==typeof t||t instanceof String}(t))return null;var i=t.split("%"),r=i[0];return 2===i.length&&!1===Number.isNaN(Number(r))?Number(r)*e/100:(i=r.split("px"),r=Number(i[0]),2===i.length&&!1===Number.isNaN(Number(r))?Number(r):null)}function _s(t,e,i,r){if(e)return e.split("/")[0]===i;var n=function(t){if(!t)return null;var e=t.split(".");return e[e.length-1]}(t);return n&&r&&r.forEach(function(t){if(n===t)return!0}),!1}function ms(t,e){return t?"".concat(t,"/").concat(e):e}function xs(t,e){var i=e.split("#");return{path:ms(t,i[0]),mediaFragmentString:i.length>1?i[1]:null}}function bs(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e)return{};var n=xs(t,e),o=n.path,s=n.mediaFragmentString,a=null;!0===function(t,e){return _s(t,e,"image",["jpg","jpeg","png","JPG","JPEG","PNG","webp"])}(e,i)?a="image":!0===function(t,e){return _s(t,e,"video",["mp4","mov","m4v","webm"])}(e,i)&&(a="video");var h={href:e,path:o,mediaFragmentString:s,resourceType:a};if(r){var u=xs(t,r);h=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),r.forEach(function(e){ps(t,e,i[e])})}return t}({},h,{fallbackHref:r,fallbackPath:u.path,fallbackMediaFragmentString:u.mediaFragmentString})}return h}function ws(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ts(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Es(t,e,i){return e&&Ts(t.prototype,e),i&&Ts(t,i),t}var Ss=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._player=e,this._readingProgression=i,this._rawSnapPointsArray=[],this._snapPointsArray=null,this._pageContainer=new Vt,this._slicesArray=[],this._progress=null,this._totalDistanceToCover=0,this._transitionForward=null,this._transitionBackward=null,this._reset(),this._setRelativeStartAndEnd()}return Es(t,[{key:"transitionForward",get:function(){return this._transitionForward}},{key:"transitionBackward",get:function(){return this._transitionBackward}},{key:"isAtStart",get:function(){return null===this._progress||0===this._progress}},{key:"isAtEnd",get:function(){return null===this._progress||1===this._progress}},{key:"isAutoScrolling",get:function(){return!!this._snapPointJumpData&&this._snapPointJumpData.isAutoScrolling}}]),Es(t,[{key:"_reset",value:function(){this._snapPointJumpData={isAutoScrolling:!1,shouldForceToEnd:!1,shouldForceToBacktrack:!1}}},{key:"_setRelativeStartAndEnd",value:function(){switch(this._relativeStart=null,this._relativeEnd=null,this._readingProgression){case"ltr":this._relativeStart={x:0,y:.5},this._relativeEnd={x:1,y:.5};break;case"rtl":this._relativeStart={x:1,y:.5},this._relativeEnd={x:0,y:.5};break;case"ttb":this._relativeStart={x:.5,y:0},this._relativeEnd={x:.5,y:1};break;case"btt":this._relativeStart={x:.5,y:1},this._relativeEnd={x:.5,y:0}}}},{key:"setTransition",value:function(t,e){switch(t){case"forward":this._transitionForward=e;break;case"backward":this._transitionBackward=e}}},{key:"addSlice",value:function(t){t&&(this._slicesArray.push(t),t.addSliceContainerToPageContainer(this._pageContainer))}},{key:"addSnapPoints",value:function(t){var e=this;t&&0!==t.length&&t.forEach(function(t){var i=t.viewport,r=t.x,n=t.y;if(!("start"!==i&&"center"!==i&&"end"!==i||null===r&&null===n)){var o={sliceIndex:e._slicesArray.length-1,viewport:i,x:r,y:n};e._rawSnapPointsArray.push(o)}})}},{key:"finishBuildingSlices",value:function(){this._slicesArray.forEach(function(t){t.finishBuilding()})}},{key:"pushContentIntoContainer",value:function(t){t.addChild(this._pageContainer)}},{key:"play",value:function(){this._slicesArray.forEach(function(t){t.play()})}},{key:"stop",value:function(){this._slicesArray.forEach(function(t){t.stop()})}},{key:"_positionSlices",value:function(){var t=this,e=0;this._slicesArray.forEach(function(i){var r=i.size,n=i.container;if(n){var o=r.width,s=r.height;switch(t._readingProgression){case"ltr":i.offset={x:e,y:0},n.position.x=e+o/2,e+=o;break;case"rtl":i.offset={x:e,y:0},n.position.x=e-o/2,e-=o;break;case"ttb":i.offset={x:0,y:e},n.position.y=e+s/2,e+=s;break;case"btt":i.offset={x:0,y:e},n.position.y=e-s/2,e-=s}}}),this._positionPageContainer(e)}},{key:"_positionPageContainer",value:function(t){this._startPosition={x:0,y:0},this._endPosition={x:0,y:0};var e=t,i=this._player.viewportSize,r=i.width,n=i.height;switch(this._readingProgression){case"ltr":(e-=r)<=.5?(this._isLargerThanViewport=!1,this._pageContainer.position.x=-e/2-r/2):(this._isLargerThanViewport=!0,this._startPosition.x=-r/2,this._endPosition.x=-e-r/2);break;case"rtl":(e+=r)>=-.5?(this._isLargerThanViewport=!1,this._pageContainer.position.x=-e/2+r/2):(this._isLargerThanViewport=!0,this._startPosition.x=r/2,this._endPosition.x=r/2-e);break;case"ttb":(e-=n)<=.5?(this._isLargerThanViewport=!1,this._pageContainer.position.x=-e/2-n/2):(this._startPosition.y=-n/2,this._isLargerThanViewport=!0,this._endPosition.y=-e-n/2);break;case"btt":(e+=n)>=-.5?(this._isLargerThanViewport=!1,this._pageContainer.position.x=-e/2+n/2):(this._isLargerThanViewport=!0,this._startPosition.y=-n/2,this._endPosition.y=n/2-e)}this._totalDistanceToCover=e,!0===this._isLargerThanViewport?this._buildRelevantSnapPoints():this._snapPointsArray=null}},{key:"_buildRelevantSnapPoints",value:function(){var t=this,e=[],i=-1;this._rawSnapPointsArray.forEach(function(r){var n=t._getProgressForSnapPoint(r);if(null!==n&&n>i){var o=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),r.forEach(function(e){ws(t,e,i[e])})}return t}({},r,{progress:n});e.push(o),i=n}}),this._snapPointsArray=e}},{key:"_getProgressForSnapPoint",value:function(t){var e=Math.abs(this._totalDistanceToCover);if(e<=.5)return null;var i=t.sliceIndex,r=t.viewport,n=t.x,o=t.y,s=this._slicesArray[i],a=s.size,h=s.offset,u=this._getAbsoluteCenter(r,{x:n,y:o},a);if(!u)return null;u.x-=h.x,u.y-=h.y;var l,c,d=(l=this._startPosition,c=u,Math.sqrt(Math.pow(c.x-l.x,2)+Math.pow(c.y-l.y,2)));return Math.min(Math.max(Math.abs(d/e),0),1)}},{key:"_getAbsoluteCenter",value:function(t,e,i){var r=this._player.viewportSize,n="ltr"===this._readingProgression||"ttb"===this._readingProgression?-1:1,o=ys(e.x,i.width),s=ys(e.y,i.height);if(null===o||null===s)return null;var a={x:n*o,y:n*s};switch(t){case"start":a.x+=(this._relativeStart.x-.5)*r.width,a.y+=(this._relativeStart.y-.5)*r.height;break;case"end":a.x+=(this._relativeEnd.x-.5)*r.width,a.y+=(this._relativeEnd.y-.5)*r.height}return a}},{key:"_setProgress",value:function(t){this._progress=t;var e=this._endPosition.x-this._startPosition.x,i=this._endPosition.y-this._startPosition.y;this._pageContainer.position.x=this._startPosition.x+t*e,this._pageContainer.position.y=this._startPosition.y+t*i}},{key:"applyScrollDelta",value:function(t){if(null!==this._progress){var e=t.deltaX,i=t.deltaY,r=this._progress,n=this._endPosition.x-this._startPosition.x;if(n>0){var o=Math.min(Math.max(this._pageContainer.position.x-e,this._startPosition.x),this._startPosition.x+n);r=Math.abs((o-this._startPosition.x)/n)}else if(n<0){var s=Math.min(Math.max(this._pageContainer.position.x-e,this._startPosition.x+n),this._startPosition.x);r=Math.abs((s-this._startPosition.x)/n)}var a=this._endPosition.y-this._startPosition.y;if(a>0){var h=Math.min(Math.max(this._pageContainer.position.y-i,this._startPosition.y),this._startPosition.y+a);r=Math.abs((h-this._startPosition.y)/a)}else if(a<0){var u=Math.min(Math.max(this._pageContainer.position.y-i,this._startPosition.y+a),this._startPosition.y);r=Math.abs((u-this._startPosition.y)/a)}this._setProgress(r)}}},{key:"goToNextSnapPoint",value:function(){var t=this._getNextSnapPointProgress();null!==t&&this._startSnapPointJump(t)}},{key:"goToPreviousSnapPoint",value:function(){var t=this._getPreviousSnapPointProgress();null!==t&&this._startSnapPointJump(t)}},{key:"_getNextSnapPointProgress",value:function(){if(!this._snapPointsArray)return null;for(var t=0;t<this._snapPointsArray.length&&this._snapPointsArray[t].progress<=this._progress;)t+=1;var e=1;return t<this._snapPointsArray.length&&(e=this._snapPointsArray[t].progress),e}},{key:"_getPreviousSnapPointProgress",value:function(){if(!this._snapPointsArray)return null;for(var t=this._snapPointsArray.length-1;t>=0&&this._snapPointsArray[t].progress>=this._progress;)t-=1;var e=0;return t>=0&&(e=this._snapPointsArray[t].progress),e}},{key:"_startSnapPointJump",value:function(t,e){this._snapPointJumpData={isAutoScrolling:!0,isGoingForward:t-this._progress>=0,targetProgress:t,startProgress:this._progress,startDate:Date.now(),mode:e},requestAnimationFrame(this._autoProgress.bind(this))}},{key:"goToClosestSnapPoint",value:function(){if(!1!==this._isLargerThanViewport){var t=this._getNextSnapPointProgress(),e=this._getPreviousSnapPointProgress(),i=t-this._progress,r=this._progress-e,n=this._progress;i<r?n=t:i>r&&(n=e),this._startSnapPointJump(n,"sticky")}}},{key:"_autoProgress",value:function(){if(!1!==this._isAutoScrolling){var t=this._snapPointJumpData,e=t.shouldForceToBacktrack,i=t.shouldForceToEnd,r=t.targetProgress,n=t.startProgress,o=t.startDate,s=t.mode,a=t.endCallback,h=Math.abs((r-n)*this._totalDistanceToCover);this._changeDuration="sticky"===s?h/this._stickyMoveSpeed:h/this._snapJumpSpeed;var u=(Date.now()-o)/this._changeDuration;if(!0===e)this._reset(),a&&a();else if(u>=1||!0===i)this._setProgress(r),this._reset();else{var l=n+(r-n)*u;this._setProgress(l),requestAnimationFrame(this._autoProgress.bind(this))}}}},{key:"forceJump",value:function(t,e){this._snapPointJumpData&&(e!==this._snapPointJumpData.isGoingForward?(this._snapPointJumpData.endCallback=t,this._snapPointJumpData.shouldForceToBacktrack=!0):this._snapPointJumpData.shouldForceToEnd=!0)}},{key:"getSliceIndexInPageForPath",value:function(t){if(!this._slicesArray||0===this._slicesArray.length)return null;for(var e=!1,i=0;i<this._slicesArray.length&&!1===e;){if(this._slicesArray[i].path===t)return e=!0,i;i+=1}return null}},{key:"goToSliceIndex",value:function(t,e){if(!0===this._isLargerThanViewport)if(null!==t){var i=this._getProgressForSliceIndex(t);this._setProgress(i||0)}else this._setProgress(!0===e?0:1)}},{key:"_getProgressForSliceIndex",value:function(t){var e={sliceIndex:t,viewport:"start",x:"rtl"===this._readingProgression?"100%":"0%",y:"btt"===this._readingProgression?"100%":"0%"};return this._getProgressForSnapPoint(e)}},{key:"resize",value:function(){var t=this;if(this._slicesArray.forEach(function(t){t.resize()}),this._positionSlices(),!1===this._isLargerThanViewport){if(!0===this.isAutoScrolling){this.forceJump(function(){t._progress=null},!this._snapPointJumpData.isGoingForward)}}else this._setProgress(this._progress||0);var e=this._player.viewportSize,i=e.width,r=e.height;"ltr"===this._readingProgression||"rtl"===this._readingProgression?(this._snapJumpSpeed=i*(1/750),this._stickyMoveSpeed=i*(1/750)):(this._snapJumpSpeed=r*(1/750),this._stickyMoveSpeed=r*(1/750))}},{key:"destroy",value:function(){this._slicesArray.forEach(function(t){t.destroy()})}}]),t}();function Ps(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function As(t,e,i){return e&&Ps(t.prototype,e),i&&Ps(t,i),t}var Cs=function(){function t(e,i,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._resourceData=e,this._overflow=i,this._fit=r,this._player=n,this._naturalWidth=0,this._naturalHeight=0,this._duration=0,this._container=new Vt,this._sprite=this._createAndAddSprite()}return As(t,[{key:"size",get:function(){if("clipped"===this._overflow){var t=this._player.viewportSize;return{width:Math.min(this._naturalWidth*this._scale,t.width),height:Math.min(this._naturalHeight*this._scale,t.height)}}return{width:this._naturalWidth*this._scale,height:this._naturalHeight*this._scale}}},{key:"container",get:function(){return this._container}},{key:"duration",get:function(){return this._duration}},{key:"path",get:function(){return this._resourceData?this._resourceData.path:null}}]),As(t,[{key:"_createAndAddSprite",value:function(){var t=new Kr;return this._container.addChild(t),t}},{key:"finishBuilding",value:function(){this._sprite.texture=this._createTexturesForSprite(),this._sprite.texture||console.log(this.size),this._centerAndClipIfNeeded()}},{key:"_centerAndClipIfNeeded",value:function(){this._sprite.anchor.set(.5),this._playableSprite&&this._playableSprite.anchor.set(.5),"clipped"===this._overflow&&(this._mask=new qr,this._container.addChild(this._mask),this._container.mask=this._mask)}},{key:"_createTexturesForSprite",value:function(){var t=null;if(!this._resourceData)return null;var e=this._resourceData,i=e.path,r=e.mediaFragmentString,n=e.resourceType;if("image"===n)t=this._getTextureFromPath(i,r);else if("video"===n){var o=this._resourceData,s=o.fallbackPath,a=o.fallbackMediaFragmentString;s&&(t=this._getTextureFromPath(s,a)),this._video=document.createElement("video"),this._video.preload="auto",this._video.loop=!0,this._video.autoplay=!1,this._video.muted=!0,this._video.src=i,this._shouldPlay=!1,this._video.addEventListener("durationchange",this._doOnDurationChange.bind(this))}return t}},{key:"_getTextureFromPath",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var i=Kn.shared.resources;if(!i||!i[t])return null;var r=i[t].texture;if(this._naturalWidth=r.width,this._naturalHeight=r.height,e){var n=function(t){var e=t.split("=");if(2!==e.length)return null;var i=e[1];if(2!==(i=i.split(":")).length)return null;var r=fs(i,2),n=r[0],o=r[1];if("percent"!==n&&"pixel"!==n)return null;var s=o.split(",");if(4!==s.length)return null;var a=fs(s,4),h=a[0],u=a[1],l=a[2],c=a[3];return h=Number(h),u=Number(u),l=Number(l),c=Number(c),gs(h)&&gs(u)&&gs(l)&&gs(c)?{unit:n,x:h,y:u,w:l,h:c}:null}(e);if(!n)return r;var o=n.unit,s=n.x,a=n.y,h=n.w,u=n.h,l=r,c=l.width,d=l.height;"percent"===o&&(s*=c/100,a*=d/100,h*=c/100,u*=d/100),s=Math.min(s,c),a=Math.min(a,d),h=Math.min(h,c),u=Math.min(u,d);var p=r.baseTexture,f=new Lt(s,a,h,u);r=new Ie(p,f),this._naturalWidth=r.width,this._naturalHeight=r.height}return r}},{key:"_doOnDurationChange",value:function(){var t=this._video,e=t.duration,i=t.videoWidth,r=t.videoHeight;if(e){var n=Ie.from(this._video);n.baseTexture.resource.autoPlay=!1,this._playableSprite=this._createAndAddSprite(),this._playableSprite.texture=n,this._playableSprite.anchor.set(.5),this._naturalWidth=i,this._naturalHeight=r,this._duration=e,this.resize(),!0===this._shouldPlay&&this._video.play()}}},{key:"addSliceContainerToPageContainer",value:function(t){t.addChild(this._container)}},{key:"play",value:function(){this._video&&this._video.duration&&(this._naturalWidth&&this._naturalHeight?this._video.play():this._shouldPlay=!0)}},{key:"stop",value:function(){this._video&&this._video.duration&&(this._video.pause(),this._video.currentTime=0)}},{key:"resize",value:function(){this._applyFit(),this._applyOverflow()}},{key:"_applyFit",value:function(){if(this._naturalWidth&&this._naturalHeight){var t=this._naturalWidth/this._naturalHeight,e=this._player.viewportSize,i=e.width,r=e.height,n=i/r,o=1;switch(this._fit){case"height":o=this._getScaleWhenForcingHeight(r);break;case"width":o=this._getScaleWhenForcingWidth(i);break;case"contain":o=t>=n?this._getScaleWhenForcingWidth(i):this._getScaleWhenForcingHeight(r);break;case"cover":o=t>=n?this._getScaleWhenForcingHeight(r):this._getScaleWhenForcingWidth(i)}this._container.scale.set(o),this._scale=o}}},{key:"_getScaleWhenForcingHeight",value:function(t){return t/this._naturalHeight}},{key:"_getScaleWhenForcingWidth",value:function(t){return t/this._naturalWidth}},{key:"_applyOverflow",value:function(){if("clipped"===this._overflow){var t=this._scale||1,e=this._player.viewportSize,i=e.width,r=e.height;this._mask.clear(),this._mask.beginFill(255),this._mask.drawRect(-i/t/2,-r/t/2,i/t,r/t),this._mask.endFill()}}},{key:"destroy",value:function(){this._video&&this._video.removeEventListener("durationchange",this._doOnDurationChange.bind(this)),this._playableSprite&&this._destroySprite(this._playableSprite),this._sprite&&this._destroySprite(this._sprite)}},{key:"_destroySprite",value:function(t){var e=t.texture;e&&this._destroyTexture(e),t.destroy({children:!0,texture:!1,baseTexture:!1})}},{key:"_destroyTexture",value:function(t){if(t){var e=t.baseTexture;e&&e.destroy();t.destroy(!1)}}}]),t}();function Os(t){return(Os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Is(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ms(t,e){return!e||"object"!==Os(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ds(t){return(Ds=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Rs(t,e){return(Rs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ks=function(t){function e(t,i,r,n,o){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(s=Ms(this,Ds(e).call(this,null,r,n,o)))._resourceDataArray=t,s._duration=!0===gs(i)&&i>0?i:0,s._resourceType="sequence",s}var i,r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rs(t,e)}(e,Cs),i=e,(r=[{key:"finishBuilding",value:function(){var t=this._createTexturesArray();0!==t.length&&(this._playableSprite=this._createAndAddAnimatedSprite(t),this._playableSprite.loop=!1,this._centerAndClipIfNeeded())}},{key:"_createAndAddAnimatedSprite",value:function(t){var e=new No(t);return this._container.addChild(e),e}},{key:"_createTexturesArray",value:function(){var t=this,e=[];if(this._resourceDataArray&&this._resourceDataArray.length>0){var i=[];if(this._resourceDataArray.forEach(function(e){var r=e.path,n=e.mediaFragmentString,o=t._getTextureFromPath(r,n);o&&(!o||t._naturalWidth&&t._naturalHeight||(t._naturalWidth=o.width,t._naturalHeight=o.height),i.push(o))}),i.length>0){var r=this._duration/this._resourceDataArray.length;e=i.map(function(t){return{texture:t,time:r}})}}return e}},{key:"play",value:function(){this._playableSprite&&this._playableSprite.play()}},{key:"gotoAndStop",value:function(t){this._playableSprite&&this._playableSprite.gotoAndStop(t)}},{key:"destroy",value:function(){var t=this;this._playableSprite&&this._playableSprite.textures&&this._playableSprite.textures.forEach(function(e){t._destroyTexture(e)})}}])&&Is(i.prototype,r),n&&Is(i,n),e}();function Fs(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ls(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ns(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Bs(t,e,i){return e&&Ns(t.prototype,e),i&&Ns(t,i),t}var Us=function(){function t(e,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._player=e,this._contentContainer=i,this._oldPageContainer=new Vt,this._newPageContainer=new Vt,this._sequenceSlicesArray=[],this._videoSlicesArray=[],this._reset()}return Bs(t,[{key:"isRunning",get:function(){return!!this._transitionData&&this._transitionData.isRunning}}]),Bs(t,[{key:"_reset",value:function(){this._transitionData={isRunning:!1,shouldForceToEnd:!1}}},{key:"addSequenceSlice",value:function(t){this._sequenceSlicesArray.push(t)}},{key:"addVideoSlice",value:function(t){this._videoSlicesArray.push(t)}},{key:"finishBuildingSlices",value:function(){this._sequenceSlicesArray.forEach(function(t){t.finishBuilding()}),this._videoSlicesArray.forEach(function(t){t.finishBuilding()})}},{key:"run",value:function(t,e,i,r){if(this._transitionData=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),r.forEach(function(e){Ls(t,e,i[e])})}return t}({},this.transitionData,t,{isRunning:!0,newPage:e,oldPage:i,isGoingForward:r}),this._newPageContainer.visible=!1,e.pushContentIntoContainer(this._newPageContainer),"sequence"===t.type)if(this._contentContainer.removeChildren(),this._contentContainer.addChild(this._newPageContainer),this._contentContainer.addChild(this._oldPageContainer),t.sequenceSlice&&0!==t.sequenceSlice.duration){this._transitionData.duration=t.duration||750;var n=t.sequenceSlice;n.resize(),n.addSliceContainerToPageContainer(this._oldPageContainer),n.play()}else this._transitionData.duration=0;else if("video"===t.type)if(this._contentContainer.removeChildren(),this._contentContainer.addChild(this._newPageContainer),this._contentContainer.addChild(this._oldPageContainer),t.videoSlice&&0!==t.videoSlice.duration){this._transitionData.duration=t.duration||1e3*t.videoSlice.duration;var o=t.videoSlice;o.resize(),o.addSliceContainerToPageContainer(this._oldPageContainer),o.play()}else this._transitionData.duration=0;else{var s;(s=this._oldPageContainer).addChild.apply(s,Fs(this._contentContainer.children)),this._transitionData.duration=t.duration||750,"slide-out"===t.type?(this._contentContainer.addChild(this._newPageContainer),this._contentContainer.addChild(this._oldPageContainer)):(this._contentContainer.addChild(this._oldPageContainer),this._contentContainer.addChild(this._newPageContainer))}this._transitionData.startTime=Date.now(),this._transitionLoop()}},{key:"_transitionLoop",value:function(){var t=this._transitionData,e=t.shouldForceToEnd,i=t.type,r=t.direction,n=t.duration,o=t.startTime,s=Date.now()-o;if(s>=n||!0===e)this._endTransition();else{var a=s/n,h=this._player.viewportSize,u=h.width,l=h.height;if("dissolve"===i&&(this._newPageContainer.alpha=a),"slide-in"===i||"push"===i)switch(r){case"ltr":this._newPageContainer.position.x=(a-1)*u;break;case"rtl":this._newPageContainer.position.x=(1-a)*u;break;case"ttb":this._newPageContainer.position.y=(a-1)*l;break;case"btt":this._newPageContainer.position.y=(1-a)*l}if("slide-out"===i||"push"===i)switch(r){case"ltr":this._oldPageContainer.position.x=a*u;break;case"rtl":this._oldPageContainer.position.x=-a*u;break;case"ttb":this._oldPageContainer.position.y=a*l;break;case"btt":this._oldPageContainer.position.y=-a*l}this._newPageContainer.visible=!0,requestAnimationFrame(this._transitionLoop.bind(this))}}},{key:"_endTransition",value:function(){var t,e=this._transitionData,i=e.sequenceSlice,r=e.videoSlice,n=e.newPage,o=e.oldPage,s=e.endCallback;this._oldPageContainer.position={x:0,y:0},this._newPageContainer.position={x:0,y:0},this._newPageContainer.alpha=1,this._newPageContainer.visible=!0,(t=this._contentContainer).addChild.apply(t,Fs(this._newPageContainer.children)),i&&i.gotoAndStop(0),r&&r.stop(),this._contentContainer.removeChild(this._newPageContainer),this._oldPageContainer.removeChildren(),this._contentContainer.removeChild(this._oldPageContainer),this._reset(),s&&s(),n&&n.play(),o&&o.stop()}},{key:"forceTransitionToEnd",value:function(t,e){this._transitionData&&(e!==this._transitionData.isGoingForward&&(this._transitionData.endCallback=t),this._transitionData.shouldForceToEnd=!0)}},{key:"resize",value:function(){if(this._transitionData&&!0===this._transitionData.isRunning){var t=this._transitionData,e=t.sequenceSlice,i=t.videoSlice,r=t.newPage,n=t.oldPage;e&&e.resize(),i&&i.resize(),n&&n.resize(),r&&r.resize()}}},{key:"destroy",value:function(){this._sequenceSlicesArray.forEach(function(t){t.destroy()}),this._videoSlicesArray.forEach(function(t){t.destroy()})}}]),t}();function js(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Hs(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var zs=function(){function t(e,i,r,n,o,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._player=e,this._textManager=i,this._interactionManager=r,this._resourceManager=n,this._contentContainer=o,this._setRatioConstraint=s,this._singlePagesArray=[],this._pagesArray=[],this._pageIndex=null,this._transitionManager=null}var e,i,r;return e=t,(i=[{key:"loadFromPath",value:function(t){var e=this;this._folderPath=t,this._loadJson().then(function(t){e._buildStoryFromJson(t)},function(t){return e._textManager.showMessage({type:"error",text:t.message})})}},{key:"loadFromData",value:function(t){this._data=t,this._buildStoryFromJson(t.json)}},{key:"_loadJson",value:function(){var t=this;return new Promise(function(e,i){var r=new XMLHttpRequest;r.open("GET","".concat(t._folderPath,"/").concat("manifest.json")),r.responseType="text",r.onload=function(){var t=r.response;try{var n=JSON.parse(t);e(n)}catch(t){i(t)}},r.onerror=function(t){i(t)},r.send()})}},{key:"_buildStoryFromJson",value:function(t){var e=this,i=t.metadata,r=t.readingOrder;if(i&&r){var n=i.readingProgression,o=i.presentation;if(n&&o){this._readingProgression=n;var s=o.viewportRatio,a=o.continuous,h=o.overflow,u=o.fit,l=o.snapBehavior,c=a||!1,d=h||"scrolled",p=u||"contain";this._buildPages(r,c,d,p),this._interactionManager.adaptToStory(this._readingProgression,l,this._goForward.bind(this),this._goBackward.bind(this),this._goToClosestSnapPoint.bind(this),this._setScrollDelta.bind(this)),this._resourceManager.loadAllResources().then(function(){e._textManager.destroy(),e._textManager=null,e._singlePagesArray.forEach(function(t){t.finishBuildingSlices()}),e._transitionManager&&e._transitionManager.finishBuildingSlices(),e._setRatioConstraint(s),e._pagesArray=e._singlePagesArray,e._goToPageWithIndex(0)},function(t){return e._textManager.showMessage({type:"error",text:t.message})})}else this._textManager.showMessage({type:"error",text:"Missing readingProgression or presentation information"})}else this._textManager.showMessage({type:"error",text:"Missing metadata or readingOrder information"})}},{key:"_buildPages",value:function(t,e,i,r){var n=this,o=null;t.forEach(function(t){var s=t.href,a=t.type,h=t.fallbackHref,u=t.properties||{},l=u.overflow,c=u.fit,d=u.transitionForward,p=u.transitionBackward,f=u.snapPoints,g=l||i,v=c||r;o&&!1!==e&&!d||(o&&n._singlePagesArray.push(o),o=new Ss(n._player,n._readingProgression),d&&o.setTransition("forward",n._createTransition(d,g,v)),p&&o.setTransition("backward",n._createTransition(p,g,v)));var y=bs(n._folderPath,s,a,h);n._folderPath||"video"!==y.resourceType||(y.path=n._data.base64DataByHref[s]);var _=new Cs(y,g,v,n._player);o.addSlice(_),n._resourceManager.addResource(y),!f||"scrolled"!==i&&"scrolled"!==g||o.addSnapPoints(f)}),this._singlePagesArray.push(o)}},{key:"_createTransition",value:function(t,e,i){var r=this;if(!t)return null;this._transitionManager||(this._transitionManager=new Us(this._player,this._contentContainer));var n=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable}))),r.forEach(function(e){js(t,e,i[e])})}return t}({},t);if("sequence"===t.type&&t.sequence){var o=t.sequence,s=[];o.forEach(function(t){var e=t.href,i=bs(r._folderPath,e,"image");s.push(i),r._resourceManager.addResource(i)});var a=t.duration||750,h=new ks(s,a,e,i,this._player);n.sequenceSlice=h,this._transitionManager.addSequenceSlice(h)}if("video"===t.type&&t.href){var u=t.href,l=bs(this._folderPath,u,"video");this._folderPath||"video"!==l.resourceType||(l.path=this._data.base64DataByHref[u]);var c=new Cs(l,e,i,this._player);n.videoSlice=c,this._transitionManager.addVideoSlice(c)}return n}},{key:"_goToPageWithIndex",value:function(t,e){if(!(t===this._pageIndex&&void 0===e||t<0||t>this._pagesArray.length-1)){var i=null===this._pageIndex||t-this._pageIndex>=0;this._pageIndex=t;var r=this._currentPage;this._currentPage=this._pagesArray[this._pageIndex],this._currentPage.resize();var n=null;r&&!0===i&&(n=r.transitionForward),!1===i&&(n=this._currentPage.transitionBackward),n&&void 0===e?this._transitionManager&&this._transitionManager.run(n,this._currentPage,r,i):(this._contentContainer.removeChildren(),this._currentPage.pushContentIntoContainer(this._contentContainer),this._currentPage.play(),r&&r.stop(),void 0!==e&&this._currentPage.goToSliceIndex(e,i))}}},{key:"_goForward",value:function(){this._turnPageOrJumpWithinAfterForcingIfRelevant(!0)}},{key:"_goBackward",value:function(){this._turnPageOrJumpWithinAfterForcingIfRelevant(!1)}},{key:"_turnPageOrJumpWithinAfterForcingIfRelevant",value:function(t){if(this._currentPage){var e=!0===t?this._turnPageOrJumpWithinForward.bind(this):this._turnPageOrJumpWithinBackward.bind(this);!0===this._currentPage.isAutoScrolling?this._currentPage.forceJump(e,t):this._transitionManager&&!0===this._transitionManager.isRunning?this._transitionManager.forceTransitionToEnd(e,t):e()}}},{key:"_turnPageOrJumpWithinForward",value:function(){this._currentPage&&(!0===this._currentPage.isAtEnd?this._goToNextPage():this._goToNextSnapPoint())}},{key:"_goToNextPage",value:function(){this._goToPageWithIndex(this._pageIndex+1)}},{key:"_goToNextSnapPoint",value:function(){this._currentPage.goToNextSnapPoint()}},{key:"_turnPageOrJumpWithinBackward",value:function(){this._currentPage&&(!0===this._currentPage.isAtStart?this._goToPreviousPage():this._goToPreviousSnapPoint())}},{key:"_goToPreviousPage",value:function(){this._goToPageWithIndex(this._pageIndex-1)}},{key:"_goToPreviousSnapPoint",value:function(){this._currentPage&&this._currentPage.goToPreviousSnapPoint()}},{key:"_goToClosestSnapPoint",value:function(){this._currentPage&&this._currentPage.goToClosestSnapPoint()}},{key:"_setScrollDelta",value:function(t){!this._currentPage||!0===this._currentPage.isAutoScrolling||this._transitionManager&&!0===this._transitionManager.isRunning||this._currentPage.applyScrollDelta(t)}},{key:"goTo",value:function(t){if(this._pagesArray&&0!==this._pagesArray.length){for(var e=!1,i=0,r=0;i<this._pagesArray.length&&!1===e;){var n=this._pagesArray[i],o=ms(this._folderPath,t),s=n.getSliceIndexInPageForPath(o);null!==s&&(e=!0,r=s),i+=1}!0===e?this._goToPageWithIndex(i-1,r):this._goToPageWithIndex(0)}}},{key:"resize",value:function(){this._transitionManager&&!0===this._transitionManager.isRunning?this._transitionManager.resize():this._currentPage&&this._currentPage.resize()}},{key:"destroy",value:function(){this._transitionManager&&this._transitionManager.destroy(),this._pagesArray.forEach(function(t){t.destroy()})}}])&&Hs(e.prototype,i),r&&Hs(e,r),t}();function Xs(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gs(t,e,i){return e&&Xs(t.prototype,e),i&&Xs(t,i),t}var Ys=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._rootElement=e,this._app=new Sn({backgroundColor:es,resolution:window.devicePixelRatio}),this._app.stage.name="stageContainer",this._rootElement.appendChild(this._app.view),this._textManager=new as(this,this._app.stage),this._contentContainer=new Vt,this._contentContainer.name="contentContainer",this._app.stage.addChild(this._contentContainer),this._app.renderer.autoDensity=!0,this._resize(),this._interactionManager=new ls(this,this._rootElement),this._story=null,this._minRatio=null,this._maxRatio=null,window.addEventListener("resize",this._resize.bind(this))}return Gs(t,[{key:"windowSize",get:function(){return this._windowSize}},{key:"viewportSize",get:function(){return this._viewportSize}}]),Gs(t,[{key:"_resize",value:function(){var t=this._rootElement.getBoundingClientRect(),e=t.width,i=t.height;this._windowSize={width:e,height:i},this._sizeViewport(),this._textManager&&this._textManager.resize(),this._story&&this._story.resize()}},{key:"_sizeViewport",value:function(){var t=this._windowSize,e=t.width,i=t.height,r=e,n=i,o=this._getApplicableRatio(),s=e/i;if(s>=o){if(r=i*o,!this._app.renderer)return;this._app.renderer.view.style.marginLeft="".concat((e-r)/2,"px"),this._app.renderer.view.style.marginTop="0px"}else if(s<o){if(n=e/o,!this._app.renderer)return;this._app.renderer.view.style.marginLeft="0px",this._app.renderer.view.style.marginTop="".concat((i-n)/2,"px")}this._viewportSize={width:r,height:n},this._app.renderer.resize(r,n),this._contentContainer.pivot={x:-r/2,y:-n/2}}},{key:"_getApplicableRatio",value:function(){var t=this._windowSize,e=t.width/t.height;return this._minRatio||this._maxRatio?this._minRatio&&!this._maxRatio?Math.max(this._minRatio,e):this._maxRatio&&!this._minRatio?Math.min(this._maxRatio,e):Math.min(Math.max(this._minRatio,e),this._maxRatio):e}},{key:"_setRatioConstraint",value:function(t){if(t){var e=t.min,i=t.max,r=vs(e),n=vs(i);r&&n&&r>n&&(r=null,n=null),this._minRatio=r,this._maxRatio=n,this._resize()}}},{key:"openDiViNaFromPath",value:function(t,e){this._interactionManager.setOnCenterTapAction(e),this._createResourceManager(),this._createStory(),this._story.loadFromPath(t)}},{key:"_createResourceManager",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._resourceManager=new ds(this._textManager,t)}},{key:"_createStory",value:function(){this._story=new zs(this,this._textManager,this._interactionManager,this._resourceManager,this._contentContainer,this._setRatioConstraint.bind(this))}},{key:"openDiViNaFromData",value:function(t){this._createResourceManager(t.base64DataByHref),this._createStory(),this._story.loadFromData(t)}},{key:"_removeTextManager",value:function(){this._textManager.destroy(),this._textManager=null}},{key:"goTo",value:function(t){this._story&&this._story.goTo(t)}},{key:"destroy",value:function(){window.removeEventListener("resize",this._resize.bind(this)),this._story.destroy(),this._resourceManager.destroy(),this._interactionManager.destroy(),this._textManager&&this._textManager.destroy();this._app.destroy(!0,{children:!0,texture:!1,baseTexture:!1})}}]),t}();e.default=Ys}]).default;
//# sourceMappingURL=divinaPlayer.js.map